Class: Entity

shf3d.Entity

Base class for entities in the 3D space.

new shf3d.Entity ()

Properties:
Name Type Description
inverseMatrix matrix.Matrix

[readonly] The inverse of matrix.

location vec3

(default: vec3(0, 0, 0)) The current location.

matrix matrix.Matrix

[readonly] The current transformation matrix.

rotationAngle number

(default: 0) The rotation angle in degrees.

rotationAxis vec3

(default: vec3(0, 1, 0)) The rotation axis.

rotationQuaternion Array.<number>

[readonly] The quaternion describing the current rotation.

scale vec3

(default: vec3(1, 1, 1)) The current scale.

visible bool

(default: true) Whether the entity is visible.

Extends

Methods

collisionsWith ()Array.<shf3d.Entity>

Performs collision detection with a vertex. Subclasses may override this method in order to implement collision detection.

Properties:
Name Type Description
v vec3

The vertex to check for.

Returns:
Type Description
Array.<shf3d.Entity>
  • The entities colliding with the vertex.

move (dv)

Moves the entity by the given directional vector. The vector is expected to be in the entity-local coordinate-system.

Name Type Description
dv vec3

The directional vector.

schedule (f)

Schedules a function to be executed with a GL context.

Name Type Description
f function

The function.