The Placement Mixin is used by all objects placed in 3D space using an origin, orientation and scale. This includes Camera, Shape, Group, Light and Speaker objects. The mixin provides helper methods for managing the placement of such objects.

Methods

CalcMatrix
(parentMatrix)->mmatrix Calculate the "mmatrix" property to a Matrix4 equivalent to origin, orientation and scale, relative to an optional passed matrix (typically, the parent's mmatrix). This is automatically performed prior to rendering the object as part of a scene.
OrientTo
Set the "orientation" property to rotate the -z axis to point towards the specified Xyz position, relative to the object's local coordinate system.

Properties

mmatrix
A Matrix4 equivalent to origin, orientation and scale, updated automatically by CalcMatrix prior to every render.
orientation
A Quat specifying the rotation used to orient the shape in its parent's coordinate system. If not specified, no rotation takes place.
origin
The location of this shape's 0,0,0 position in the shape's parent's coordinate system. This can be used to specify where to render this shape within its parent group's space. If not specified, +Xyz(0,0,0) is assumed.
scale
An Xyz vector specifying how much to re-size the shape's vertices when rendering in the parent group, as defined by the 'view' method. The default is no scaling: +Xyz(1.,1.,1.)