Sprite3D
Represents a sprite in the Kray game engine.
Properties
The x-component of the 3D acceleration of the Positionable3D object.
The y-component of the 3D acceleration of the Positionable3D object.
The z-component of the 3D acceleration of the Positionable3D object.
Whether the sprite can collide with other sprites. False means it cannot.
A set of all 3D sprites that are currently colliding with this sprite. Uses spatial hashing for O(n) average case complexity.
The current costume that the sprite is wearing.
The index of the current costume being used by this sprite.
The friction coefficient of the Positionable object. This is used in physics calculations to determine the frictional force acting on the object. The default value is defaultFrictionCoefficient.
The mass multiplier of the Positionable object. This is used in physics calculations to determine the effective mass of the object. The default value is 1.0.
The restitution coefficient of the Positionable object. This is used in physics calculations to determine how bouncy the object is after collisions. The default value is defaultRestitutionCoefficient.
The spin factor of the Positionable object.
The stored rotation of the 3D sprite as Euler angles (pitch, yaw, roll) in radians. This is the source of truth for rotation, separate from the transform matrix.
The surface area of the object's bounding box, based on its size parameters.
The target rotation steps to move toward then on the ground.
The x-component of the 3D velocity of the Positionable3D object.
The y-component of the 3D velocity of the Positionable3D object.
The z-component of the 3D velocity of the Positionable3D object.
Functions
Adds a costume to this sprite.
Adds rotation to a 3D sprite that will be applied gradually over multiple frames.
Changes the current costume of this sprite to the next one in the list. Loops back to the first costume if currently at the last one.
Changes the current costume of this sprite to the previous one in the list. Loops back to the last costume if currently at the first one.
Removes the specified costume from this sprite.
Removes the costume at the specified index from this sprite.
Sets the x, y, and z components of the 3D acceleration of the Positionable3D object.
Sets the costume at the specified index for this sprite.
Sets the costumes for this sprite.
Sets the current costume of this sprite to the specified image. If the image is not already a costume of this sprite, it is added.
Sets the x, y, and z components of the 3D velocity of the Positionable3D object.