Class Index | File Index

Classes


Class VENISON.PHYSICS.PhysicsManager

Singleton used to update and communicate with the physics engine.
Defined in: venison_engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
The number of iterations to use for the physics update.
 
Set to true if physics debug info should be drawn.
Method Summary
Method Attributes Method Name and Description
 
fnApplyImpulseAt(iEntityID, iPosition, iImpulse)
Tell the physics engine to apply an impulse at a position on an entity.
 
fnGetCenterOfMass(iEntityID)
Get the entitys center of mass.
 
Get the array of collision categories.
 
Get the gravity vector.
 
Get the angular velocity of an entity.
 
Get the linear velocity of an entity.
 
fnRayCastAll(iRayStartX, iRayStartY, iRayEndX, iRayEndY)
Get an array with all entities that are hit by a ray.
 
fnRayCastOne(iRayStartX, iRayStartY, iRayEndX, iRayEndY)
Get the first entity that is hit by a ray.
 
fnSetGravity(iX, iY)
Set the gravity vector and tell the physics engine of the update.
Class Detail
VENISON.PHYSICS.PhysicsManager()
Field Detail
{Number} iterations
The number of iterations to use for the physics update.
Default Value:
10

{Boolean} renderDebugInfo
Set to true if physics debug info should be drawn.
Default Value:
false
Method Detail
fnApplyImpulseAt(iEntityID, iPosition, iImpulse)
Tell the physics engine to apply an impulse at a position on an entity.
Parameters:
{Number} iEntityID
The ID of the entity to give an impulse.
{Object} iPosition
An object with x and y properties describing the position in world space where the impulse should be applied.
{Object} iImpulse
An object with x and y properties describing the impulse to apply.

{VENISON.UTILITIES.Vector2} fnGetCenterOfMass(iEntityID)
Get the entitys center of mass.
Parameters:
{VENISON.UTILITIES.Vector2} iEntityID
The ID of the entity.
Returns:
{VENISON.UTILITIES.Vector2} The center of mass of the entity with ID iID.

{Array} fnGetCollisionCategoryArray()
Get the array of collision categories.
Returns:
{Array} The array of all collision categories currently in use by the physics engine represented as strings.

{VENISON.UTILITIES.Vector2} fnGetGravity()
Get the gravity vector.
Returns:
{VENISON.UTILITIES.Vector2} The current world gravity. Remember that positive y is downwards!

{Number} fnGetPhysicsEntityAngularVelocity(iEntityID)
Get the angular velocity of an entity.
Parameters:
{Number} iEntityID
The ID of the entity.
Returns:
{Number} The angular velocity of the entity with ID iID, in radians per seconds.

{VENISON.UTILITIES.Vector2} fnGetPhysicsEntityLinearVelocity(iEntityID)
Get the linear velocity of an entity.
Parameters:
{Number} iEntityID
The ID of the entity.
Returns:
{VENISON.UTILITIES.Vector2} The linear velocity of the entity with ID iID, in pixels per second.

{Array} fnRayCastAll(iRayStartX, iRayStartY, iRayEndX, iRayEndY)
Get an array with all entities that are hit by a ray.
Parameters:
{Number} iRayStartX
The x-value of the starting point of the ray.
{Number} iRayStartY
The y-value of the starting point of the ray.
{Number} iRayEndX
The x-value of the end point of the ray.
{Number} iRayEndY
The y-value of the end point of the ray.
Returns:
{Array} All physically enabled (that is, it has a PhysicProperty, at least one physics shape and is active in the physics simulation) game entities that the ray hits.
See:
VENISON.ENTITY.GameEntity

{VENISON.ENTITY.GameEntity} fnRayCastOne(iRayStartX, iRayStartY, iRayEndX, iRayEndY)
Get the first entity that is hit by a ray.
Parameters:
{Number} iRayStartX
The x-value of the starting point of the ray.
{Number} iRayStartY
The y-value of the starting point of the ray.
{Number} iRayEndX
The x-value of the end point of the ray.
{Number} iRayEndY
The y-value of the end point of the ray.
Returns:
{VENISON.ENTITY.GameEntity} The first physically enabled (that is, it has a PhysicProperty, at least one physics shape and is active in the physics simulation) game entity that the ray hits.

fnSetGravity(iX, iY)
Set the gravity vector and tell the physics engine of the update.
Parameters:
{Number} iX
The horizontal component of the gravity vector.
{Number} iY
The vertical component of the gravity vector.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 05 2011 18:47:29 GMT+0200 (CEST)