Skip to main content

Collision

class Collision

Describes the collision of an object in the scene.


public class Collision

This class has a static subclass.

public static class Contact

β€” Constructors (1) β€”

ConstructorDescription
Collision()Creates a new instance of Collision.

β€” Methods (8) β€”

NameDescription
Vector3 getNormal()Returns the contact point normal.
void setNormal(Vector3 vector)Sets the point normal of the contact to be "vector" argument.
Vector3 getContactPoint()Returns the description of the contact point where the collision occurs.
void setContactPoint(Vector3 vector)Defines the description of the contact point where the collision occurs to be "vector" argument.
SpatialObject getOtherObject()Returns the other object it collided with.
void setOtherObject(SpatialObject otherObject)Defines the other object it collided with to be "otherObject" argument.
float getImpulse()Returns the amount of thrust the collision applied.
void setImpulse(float value)Sets the amount of boost applied to the collision to be "value" argument.
PhysicsEntity getOtherPhysics()Returns the [PhisycsEntity] that the Collision collided with.
void setOtherPhysics(PhysicsEntity otherObject)Sets the [PhisycsEntity] of Collision.
Collider getCollider()Returns the current Collider of Collision.
void setCollider(Collider otherObject)Sets the current Collider of Collision.
float getImpulse()Returns the current Collision impulse.
void setImpulse(float value)Sets the current Collision impulse.
float getDistance()Returns the current distance from the Collision.
void setDistance(float value)Sets the current distance from the Collision.
int contactCount()Returns the current contact amount of the Collision.
int getContactCount()Returns the current contact amount of the Collision.
[Contact] contactAt(int index)Returns the Object to which [Contact] collided through index defined in the argument.

public static class Contact

β€” Constructors (1) β€”

ConstructorDescription
Contact()Creates a new instance of Contact.

β€” Methods (10) β€”

NameDescription
Vector3 getNormal()Returns the normals of the Vector that Contact detected (Collided).
void setNormal(Vector3 vector)Sets the normals of the Vector defined to be the argument.
Vector3 getContactPoint()Returns the current Contact point of contact.
void setContactPoint(Vector3 vector)Sets the current Contact point of contact.
float getImpulse()Returns the current momentum of Contact.
void setImpulse(float value)Defines the current momentum of Contact.
float getDistance()Returns the current distance from the Contact.
void setDistance(float value)Sets the current distance from Contact.
Collider getCollider()Returns the current Collider of the Object that Contact detected (Collided).
void setCollider(Collider otherObject)Sets the current Collider of the Object that Contact has detected (Collided).