ScaleGizmo

ScaleGizmo

Update local scale of target entity

Constructor

new ScaleGizmo()

Members

parentWorldTransformInvertMatrix :Matrix4

the invert of parent entity world matrix. If parent does not exist, the value will be Matrix4.IDENTITY.invert()

Methods

activate(props)

When activate the rotation gizmo, set the axis plane and line. Also calculate parentWorldTransformInvertMatrix and cache the result for future use.

Parameters:
Name Type Description
props Object

copyTransform(transform)

Scale gizmo needs to inherit both rotation and scaleRotation to represent the correct direction of scale.

Parameters:
Name Type Description
transform Transform

target entity world transform

getGizmoLocalToWorldPosition(local, world)

get world position of points in gizmo local space

Parameters:
Name Type Description
local Vector3
world Vector3

process(mouseState, oldMouseState)

transform update in each frame when scale gizmo is active.

Parameters:
Name Type Description
mouseState Vector2

x,y coord of mouse

oldMouseState Vector2

old x,y coord of mouse