KS.Reactor.ksTransform Class Reference

Transform with methods for moving entities. More...

Inheritance diagram for KS.Reactor.ksTransform:
KS.Reactor.ksIReadOnlyTransform

Public Member Functions

void Move (ksVector3 delta)
 Adds a delta to the transform position. More...
 
void MoveTo (ksVector3 position)
 Moves the entity to a new position. More...
 
void MoveTowards (ksVector3 position, float delta)
 Moves the transform towards a position. More...
 
void Teleport (ksVector3 position)
 Teleports the entity to a location. More...
 
void RotateTo (ksQuaternion rotation)
 Sets the rotation. More...
 
void ScaleTo (ksVector3 scale)
 Sets the scale. More...
 
void Rotate (ksQuaternion rotation)
 Rotates the transform. More...
 
void RotateLocal (ksQuaternion rotation)
 Rotates the transform in local space. More...
 
void Rotate (ksVector3 euler)
 Rotates the transform using euler angles. More...
 
void RotateRadians (ksVector3 euler)
 Rotates the transform using euler angles. More...
 
void RotateLocal (ksVector3 euler)
 Rotates the transform locally using euler angles. More...
 
void RotateLocalRadians (ksVector3 euler)
 Rotates the transform locally user euler angles. More...
 
void Rotate (ksVector3 axis, float angle)
 Rotates the transform. More...
 
void RotateRadians (ksVector3 axis, float angle)
 Rotates the transform. More...
 
void LookAt (ksVector3 position)
 Rotates the transform to look at a position. More...
 
void LookAt (ksVector3 position, ksVector3 up)
 Rotates the transform to look at a position. More...
 
void RotateTowards (ksQuaternion target, float deltaAngle)
 Rotates the transform towards a rotation. More...
 
void RotateTowards (ksVector3 position, float deltaAngle)
 Rotates the transform towards a position. More...
 
void RotateTowards (ksVector3 position, ksVector3 up, float deltaAngle)
 Rotates the transform towards a position. More...
 
void RotateTowardsRadians (ksQuaternion target, float deltaAngle)
 Rotates the transform towards a rotation. More...
 
void RotateTowardsRadians (ksVector3 position, float deltaAngle)
 Rotates the transform towards a position. More...
 
void RotateTowardsRadians (ksVector3 position, ksVector3 up, float deltaAngle)
 Rotates the transform towards a position. More...
 
void AddAngularDisplacement (ksVector3 angularDisplacement)
 Rotates the transform using angular displacement. More...
 
void AddAngularDisplacementRadians (ksVector3 angularDisplacement)
 Rotates the transform using angular displacement. More...
 
void Pitch (float angle)
 Rotates the transform through the world right axis. More...
 
void PitchRadians (float angle)
 Rotates the transform through the world right axis. More...
 
void PitchLocal (float angle)
 Rotates the transform through the local right axis. More...
 
void PitchLocalRadians (float angle)
 Rotates the transform through the local right axis. More...
 
void Yaw (float angle)
 Rotates the transform through the world up axis. More...
 
void YawRadians (float angle)
 Rotates the transform through the world up axis. More...
 
void YawLocal (float angle)
 Rotates the transform through the local up axis. More...
 
void YawLocalRadians (float angle)
 Rotates the transform through the local up axis. More...
 
void Roll (float angle)
 Rotates the transform through the world forward axis. More...
 
void RollRadians (float angle)
 Rotates the transform through the world forward axis. More...
 
void RollLocal (float angle)
 Rotates the transform through the local forward axis. More...
 
void RollLocalRadians (float angle)
 Rotates the transform through the local forward axis. More...
 

Static Public Attributes

static float PositionTolerance = 0f
 Position tolerance defines the minimum position delta necessary for the translation to be applied. More...
 
static float RotationTolerance = 0f
 Rotation tolerance defines the minimum delta on any one of the x,y,z,w parts of a quaternion rotation necessary for the rotation to be applied. More...
 
static float ScaleTolerance = 0f
 Scale tolerance defines the minimum position delta necessary for the scale to be applied. More...
 

Properties

ksVector3 Position [get, set]
 Position. More...
 
ksQuaternion Rotation [get, set]
 Rotation. More...
 
ksVector3 Scale [get, set]
 Scale. More...
 
bool? IsPermanent [get, set]
 Is this a permanent entity? Permanent entities are static entities that cannot be moved or deleted. More...
 
- Properties inherited from KS.Reactor.ksIReadOnlyTransform
ksVector3 Position [get]
 Position More...
 
ksQuaternion Rotation [get]
 Rotation More...
 
ksVector3 Scale [get]
 Scale More...
 

Detailed Description

Transform with methods for moving entities.

Their are two kinds of movement: teleportation and moving. Moving will test for collisions along the way and teleportation will not. If you make more than one move call in a frame, the collision check will be along a straight path from the position at the start of the frame to the end position. You cannot do a move and a teleport in the same frame. If you make both calls the entity will teleport.

Member Function Documentation

◆ AddAngularDisplacement()

void KS.Reactor.ksTransform.AddAngularDisplacement ( ksVector3  angularDisplacement)

Rotates the transform using angular displacement.

Parameters
angularDisplacementAngular displacement in degrees.

◆ AddAngularDisplacementRadians()

void KS.Reactor.ksTransform.AddAngularDisplacementRadians ( ksVector3  angularDisplacement)

Rotates the transform using angular displacement.

Parameters
angularDisplacementAngular displacement in radians.

◆ LookAt() [1/2]

void KS.Reactor.ksTransform.LookAt ( ksVector3  position)

Rotates the transform to look at a position.

It will try to orient local up to be ksVector3.Up.

Parameters
positionPosition in world space to look at.

◆ LookAt() [2/2]

void KS.Reactor.ksTransform.LookAt ( ksVector3  position,
ksVector3  up 
)

Rotates the transform to look at a position.

Parameters
positionPosition in world space to look at.
upUp vector to try and orient local up to.

◆ Move()

void KS.Reactor.ksTransform.Move ( ksVector3  delta)

Adds a delta to the transform position.

Parameters
deltaDelta to add to position.

◆ MoveTo()

void KS.Reactor.ksTransform.MoveTo ( ksVector3  position)

Moves the entity to a new position.

Parameters
positionPosition to move to.

◆ MoveTowards()

void KS.Reactor.ksTransform.MoveTowards ( ksVector3  position,
float  delta 
)

Moves the transform towards a position.

Parameters
positionTarget to move towards.
deltaDelta to move by. It will not overshoot the target. Negative values will move away from the target.

◆ Pitch()

void KS.Reactor.ksTransform.Pitch ( float  angle)

Rotates the transform through the world right axis.

Parameters
angleAngle to rotate in degrees.

◆ PitchLocal()

void KS.Reactor.ksTransform.PitchLocal ( float  angle)

Rotates the transform through the local right axis.

Parameters
angleAngle to rotate in degrees.

◆ PitchLocalRadians()

void KS.Reactor.ksTransform.PitchLocalRadians ( float  angle)

Rotates the transform through the local right axis.

Parameters
angleAngle to rotate in radians.

◆ PitchRadians()

void KS.Reactor.ksTransform.PitchRadians ( float  angle)

Rotates the transform through the world right axis.

Parameters
angleAngle to rotate in radians.

◆ Roll()

void KS.Reactor.ksTransform.Roll ( float  angle)

Rotates the transform through the world forward axis.

Parameters
angleAngle to rotate in degrees.

◆ RollLocal()

void KS.Reactor.ksTransform.RollLocal ( float  angle)

Rotates the transform through the local forward axis.

Parameters
angleAngle to rotate in degrees.

◆ RollLocalRadians()

void KS.Reactor.ksTransform.RollLocalRadians ( float  angle)

Rotates the transform through the local forward axis.

Parameters
angleAngle to rotate in radians.

◆ RollRadians()

void KS.Reactor.ksTransform.RollRadians ( float  angle)

Rotates the transform through the world forward axis.

Parameters
angleAngle to rotate in radians.

◆ Rotate() [1/3]

void KS.Reactor.ksTransform.Rotate ( ksQuaternion  rotation)

Rotates the transform.

Parameters
rotationRotation to rotate by.

◆ Rotate() [2/3]

void KS.Reactor.ksTransform.Rotate ( ksVector3  axis,
float  angle 
)

Rotates the transform.

Parameters
axisAxis of rotation.
angleAngle to rotate in degrees.

◆ Rotate() [3/3]

void KS.Reactor.ksTransform.Rotate ( ksVector3  euler)

Rotates the transform using euler angles.

Parameters
eulerEuler angles in degrees.

◆ RotateLocal() [1/2]

void KS.Reactor.ksTransform.RotateLocal ( ksQuaternion  rotation)

Rotates the transform in local space.

Parameters
rotationRotation to rotate by.

◆ RotateLocal() [2/2]

void KS.Reactor.ksTransform.RotateLocal ( ksVector3  euler)

Rotates the transform locally using euler angles.

Parameters
eulerEuler angles in degrees.

◆ RotateLocalRadians()

void KS.Reactor.ksTransform.RotateLocalRadians ( ksVector3  euler)

Rotates the transform locally user euler angles.

Parameters
eulerEuler angles in radians.

◆ RotateRadians() [1/2]

void KS.Reactor.ksTransform.RotateRadians ( ksVector3  axis,
float  angle 
)

Rotates the transform.

Parameters
axisAxis of rotation.
angleAngle to rotate in radians.

◆ RotateRadians() [2/2]

void KS.Reactor.ksTransform.RotateRadians ( ksVector3  euler)

Rotates the transform using euler angles.

Parameters
eulerEuler angles in radians.

◆ RotateTo()

void KS.Reactor.ksTransform.RotateTo ( ksQuaternion  rotation)

Sets the rotation.

Parameters
rotationRotation to rotate to.

◆ RotateTowards() [1/3]

void KS.Reactor.ksTransform.RotateTowards ( ksQuaternion  target,
float  deltaAngle 
)

Rotates the transform towards a rotation.

Parameters
targetTarget to rotate towards.
deltaAngleDelta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ RotateTowards() [2/3]

void KS.Reactor.ksTransform.RotateTowards ( ksVector3  position,
float  deltaAngle 
)

Rotates the transform towards a position.

It will try to orient local up to be ksVector3.Up.

Parameters
positionPosition in world space to rotate towards.
deltaAngleDelta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ RotateTowards() [3/3]

void KS.Reactor.ksTransform.RotateTowards ( ksVector3  position,
ksVector3  up,
float  deltaAngle 
)

Rotates the transform towards a position.

Parameters
positionPosition in world space to rotate towards.
upUp vector to try and orient local up to.
deltaAngleDelta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ RotateTowardsRadians() [1/3]

void KS.Reactor.ksTransform.RotateTowardsRadians ( ksQuaternion  target,
float  deltaAngle 
)

Rotates the transform towards a rotation.

Parameters
targetTarget to rotate towards.
deltaAngleDelta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ RotateTowardsRadians() [2/3]

void KS.Reactor.ksTransform.RotateTowardsRadians ( ksVector3  position,
float  deltaAngle 
)

Rotates the transform towards a position.

It will try to orient local up to be ksVector3.Up.

Parameters
positionPosition in world space to rotate towards.
deltaAngleDelta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ RotateTowardsRadians() [3/3]

void KS.Reactor.ksTransform.RotateTowardsRadians ( ksVector3  position,
ksVector3  up,
float  deltaAngle 
)

Rotates the transform towards a position.

Parameters
positionPosition in world space to rotate towards.
upUp vector to try and orient local up to.
deltaAngleDelta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target.

◆ ScaleTo()

void KS.Reactor.ksTransform.ScaleTo ( ksVector3  scale)

Sets the scale.

Parameters
scale

◆ Teleport()

void KS.Reactor.ksTransform.Teleport ( ksVector3  position)

Teleports the entity to a location.

Parameters
positionPosition to teleport to.

◆ Yaw()

void KS.Reactor.ksTransform.Yaw ( float  angle)

Rotates the transform through the world up axis.

Parameters
angleAngle to rotate in degrees.

◆ YawLocal()

void KS.Reactor.ksTransform.YawLocal ( float  angle)

Rotates the transform through the local up axis.

Parameters
angleAngle to rotate in degrees.

◆ YawLocalRadians()

void KS.Reactor.ksTransform.YawLocalRadians ( float  angle)

Rotates the transform through the local up axis.

Parameters
angleAngle to rotate in radians.

◆ YawRadians()

void KS.Reactor.ksTransform.YawRadians ( float  angle)

Rotates the transform through the world up axis.

Parameters
angleAngle to rotate in radians.

Member Data Documentation

◆ PositionTolerance

float KS.Reactor.ksTransform.PositionTolerance = 0f
static

Position tolerance defines the minimum position delta necessary for the translation to be applied.

A higher value will have the effect of stabilizing objects at the cost of positional accuracy.

◆ RotationTolerance

float KS.Reactor.ksTransform.RotationTolerance = 0f
static

Rotation tolerance defines the minimum delta on any one of the x,y,z,w parts of a quaternion rotation necessary for the rotation to be applied.

A higher value will have the effect of stabilizing objects at the cost of rotational accuracy.

◆ ScaleTolerance

float KS.Reactor.ksTransform.ScaleTolerance = 0f
static

Scale tolerance defines the minimum position delta necessary for the scale to be applied.

A higher value will have the effect of stabilizing objects at the cost of positional accuracy.

Property Documentation

◆ IsPermanent

bool? KS.Reactor.ksTransform.IsPermanent
getset

Is this a permanent entity? Permanent entities are static entities that cannot be moved or deleted.

They are not sent to clients since clients will already know where they are.

◆ Position

ksVector3 KS.Reactor.ksTransform.Position
getset

Position.

◆ Rotation

ksQuaternion KS.Reactor.ksTransform.Rotation
getset

Rotation.

◆ Scale

ksVector3 KS.Reactor.ksTransform.Scale
getset

Scale.