Skip to content

Commit 9644050

Browse files
augmedonisYour Name
andauthored
docs: additional customizing camera controls documentation for GH-169 (#178)
* Add Additional Camera Control Documentation * Revert small formatting change --------- Co-authored-by: Your Name <you@example.com>
1 parent 5734273 commit 9644050

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

content/docs/en/guides/plugin/customizing-camera-controls.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ settings.distance = 20.0f;
5050
settings.displayCursor = true;
5151
settings.isFirstPerson = false;
5252
settings.movementForceRotationType = MovementForceRotationType.Custom;
53+
// Align movement with camera yaw (horizontal rotation only)
54+
settings.movementForceRotation = new Direction(-0.7853981634f, 0.0f, 0.0f); // 45° left
5355
settings.eyeOffset = true;
5456
settings.positionDistanceOffsetType = PositionDistanceOffsetType.DistanceOffset;
5557
settings.rotationType = RotationType.Custom;
@@ -76,6 +78,34 @@ settings.rotationType = RotationType.Custom;
7678
settings.mouseInputType = MouseInputType.LookAtPlane;
7779
settings.planeNormal = new Vector3f(0.0f, 0.0f, 1.0f); // Side plane
7880
```
81+
## Common Settings Explained
82+
83+
### Position & Rotation
84+
- **`positionLerpSpeed`** (0.0-1.0): How smoothly the camera follows the player. Lower = smoother but slower response.
85+
- **`rotationLerpSpeed`** (0.0-1.0): How smoothly the camera rotates. Lower = smoother but slower response.
86+
- **`distance`**: Camera distance from player. Higher = zoomed out more.
87+
- **`rotation`**: Camera angle as `Direction(yaw, pitch, roll)` in radians.
88+
- **`rotationType`**: How rotation is calculated. `RotationType.Custom` uses your `rotation` value.
89+
90+
### Movement Alignment
91+
- **`movementForceRotationType`**:
92+
- `MovementForceRotationType.AttachedToHead` = movement follows where player looks
93+
- `MovementForceRotationType.Custom` = use `movementForceRotation` value
94+
- **`movementForceRotation`**: When using `Custom`, this sets the direction for W/S movement. Match yaw with camera but keep pitch at 0.
95+
96+
### Input & Display
97+
- **`displayCursor`**: Show/hide mouse cursor.
98+
- **`mouseInputType`**:
99+
- `MouseInputType.LookAtPlane` = mouse moves cursor on a plane (good for top-down)
100+
- `MouseInputType.LookAtTarget` = mouse rotates camera
101+
- **`planeNormal`**: For `LookAtPlane`, defines which plane the mouse moves on. `(0,1,0)` = ground plane.
102+
103+
### Advanced
104+
- **`positionDistanceOffsetType`**:
105+
- `DistanceOffset` = simple distance offset
106+
- `DistanceOffsetRaycast` = prevents camera clipping through walls
107+
- **`eyeOffset`**: Offset camera from player's eye position.
108+
- **`movementMultiplier`**: Scale movement on each axis. `(1,1,0)` = lock Z-axis for 2D movement.
79109

80110
---
81111

@@ -102,6 +132,8 @@ import com.hypixel.hytale.protocol.packets.camera.SetServerCamera;
102132
- **Wall clipping:** Use `PositionDistanceOffsetType.DistanceOffsetRaycast`
103133
- **Lock camera:** Set `isLocked = true` in the packet to prevent player changes
104134
- **2D movement:** Set `movementMultiplier` to zero out an axis
135+
- **Isometric cameras:** Always set `movementForceRotation` to match camera yaw for proper movement alignment
136+
- **Angle calculations:** Use `Math.toRadians(degrees)` or `degrees * Math.PI / 180.0` to convert degrees to radians
105137

106138
---
107139

0 commit comments

Comments
 (0)