PhysicsAPI¶
Beta
PhysicsAPI
is an interface which defines properties, events, and functions for objects which simulates physics.Functions¶
Fired when the entity has been hit.
Fired when the character enters a trigger.
Fired when the character exit a trigger.
Fired when the character enters another character or rigidbody.
Fired when the character exits another character or rigidbody.
Applies a force to the rigidbody.
entity
Indicates the rigidbody to applied a force.force
force
Applies an impulse to the rigidbody.
entity
The rigidbody to applies an impulse.force
force
Applies a torque to the rigidbody.
entity
The rigidbody to apply a torque.torque
Torque
Applies a force at the specified position.
Applies a force at the specified local position.
Applies a local force at the specified local position.
void PhysicsAPI.AddExplosionImpulseForce(YaEntity entity, number explosionForce, float3 explosionPosition, number radius, number upwardsModifier)Beta
Applies an explosion at the specified position.
Sets the angular velocity.
angVel
angle velocity
Sets the linear velocity.
linVel
linear velocity
Gets the angular velocity.
Gets the linear velocity.
void PhysicsAPI.ResetPositionAndRotation(YaEntity entity, float3 pos, quaternion rotate, boolean clearVelocity)Beta
Resets the position and rotation of the entity.
clearVelocity
Ignore physics velocity on entity
Enables collisions on the entity.
Checks if the entity is in the Trigger box.
YaQueryResult PhysicsAPI.RaycastSingle(float3 origin, float3 direction, YaQueryParameter parameter)Beta
Returns only the first entity contacted with the raycast.
origin
origindirection
directionparameter
refer to YaQueryParameter
Queries for all entities in a certain area.
origin
origin