-
Notifications
You must be signed in to change notification settings - Fork 7
client.controllers.Rotation.Rotation
client/controllers/Rotation.Rotation
Handles the rotation of a player's body to match the direction of their camera.
OnInit
• Enabled: boolean = true
Other controllers can access this Enabled property to disable the body rotator
src/client/controllers/Rotation.ts:20
• Private delay: number = 0.1
src/client/controllers/Rotation.ts:22
• Private janitor: Janitor<void>
src/client/controllers/Rotation.ts:21
▸ Start(character): void
Starts the character's rotation by connecting the renderstepped event to the this.UpdateOwnRotation method and fires an event every this.delay seconds which informs the server of the player's new body rotation
| Name | Type |
|---|---|
character |
Model |
void
src/client/controllers/Rotation.ts:46
▸ Private Stop(): void
Simply calls cleanup on the janitor to stop any connected events such as the renderstepped event which is added in Start()
void
src/client/controllers/Rotation.ts:280
▸ UpdateOwnRotation(NeckYOffset?, RightShoulderXOffset?, RightShoulderYOffset?, LeftShoulderXOffset?, LeftShoulderYOffset?): void
Takes in a set of default offsets which should have been gathered before setting this as this could possibly alter the offsets and then updates the cframes of the limbs to face the same direction the camera is facing.
| Name | Type | Default value |
|---|---|---|
NeckYOffset |
number |
0 |
RightShoulderXOffset |
number |
0 |
RightShoulderYOffset |
number |
0 |
LeftShoulderXOffset |
number |
0 |
LeftShoulderYOffset |
number |
0 |
void
src/client/controllers/Rotation.ts:124
▸ onInit(): void
Manages the starting of the BodyRotation when the player's character is created and connects to the UpdateRotation client event for when the rotation of other character's updates so that it replicates here.
void
OnInit.onInit
src/client/controllers/Rotation.ts:27
▸ Static Private CapX(value): number
Is used to clamp X rotation values.
| Name | Type |
|---|---|
value |
number |
number
a number between -0.5 and 0.5.
src/client/controllers/Rotation.ts:299
▸ Static Private CapY(value): number
Is used to clamp Y rotation values.
| Name | Type |
|---|---|
value |
number |
number
a number which if negative is divded by 3 to make it less negative and then clamped to be between -0.5 and 0.5.
src/client/controllers/Rotation.ts:288
▸ Static Private Tween(joint, NewCFrame, time?): void
Tweens the joint's cframe to be the newcframe over the a period of time equvalent which is the time parameter
| Name | Type | Default value |
|---|---|---|
joint |
Motor6D |
undefined |
NewCFrame |
CFrame |
undefined |
time |
number |
0.25 |
void
src/client/controllers/Rotation.ts:306
▸ Static Private UpdateOtherRotation(player, neckCFrame, waistCFrame, leftShoulderCFrame, rightShoulderCFrame): void
takes in a player and their joints as parameters and finds the motor6ds for the cframes on the character of the player argument and tweens the motor6ds C0 to equal the CFrame passed in
| Name | Type |
|---|---|
player |
Player |
neckCFrame |
CFrame |
waistCFrame |
CFrame |
leftShoulderCFrame |
CFrame |
rightShoulderCFrame |
CFrame |
void
- client/controllers/SpringCam
- client/controllers/Direction
- client/controllers/Rotation
- client/controllers/Shake
- client/controllers/Input
- server/modules/InputParser
- server/modules/Middleware
- server/modules/AnimPlayer
- server/modules/Action
- server/modules/Defer