|
|
@@ -38,7 +38,9 @@ namespace Polycode {
|
|
|
PhysicsScreenEntity() { collisionOnly = false; }
|
|
|
|
|
|
PhysicsScreenEntity(ScreenEntity *entity, b2World *world, Number worldScale, int entType, bool isStatic, Number friction, Number density, Number restitution, bool isSensor, bool fixedRotation, int groupIndex = 0);
|
|
|
- virtual ~PhysicsScreenEntity();
|
|
|
+ virtual ~PhysicsScreenEntity();
|
|
|
+
|
|
|
+ virtual void Update();
|
|
|
|
|
|
/**
|
|
|
* Returns the screen entity associated with this physics entity.
|
|
|
@@ -51,32 +53,37 @@ namespace Polycode {
|
|
|
void applyTorque(Number torque);
|
|
|
|
|
|
/**
|
|
|
- * Applies force to the physics entity
|
|
|
- */
|
|
|
+ * Applies force to the physics entity
|
|
|
+ */
|
|
|
void applyForce(Vector2 force);
|
|
|
-
|
|
|
- void setTransform(Vector2 pos, Number angle);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Applies an impulse to the physics entity
|
|
|
+ */
|
|
|
+ void applyImpulse(Number fx, Number fy);
|
|
|
|
|
|
- virtual void Update();
|
|
|
+ /**
|
|
|
+ * Sets the position and rotation of entity
|
|
|
+ */
|
|
|
+ void setTransform(Vector2 pos, Number angle);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets the velocity of the physics entity
|
|
|
+ */
|
|
|
void setVelocity(Number fx, Number fy);
|
|
|
void setVelocityX( Number fx);
|
|
|
void setVelocityY(Number fy);
|
|
|
|
|
|
- void applyImpulse(Number fx, Number fy);
|
|
|
-
|
|
|
/**
|
|
|
- * Sets the damping of the physics entity
|
|
|
+ * Sets the dampening of the physics entity
|
|
|
*/
|
|
|
-
|
|
|
void setLinearDamping(Number damping);
|
|
|
void setAngularDamping(Number damping);
|
|
|
void setFriction(Number friction);
|
|
|
|
|
|
/**
|
|
|
- * Returns damping information
|
|
|
+ * Returns dampening information
|
|
|
*/
|
|
|
-
|
|
|
Number getLinearDamping();
|
|
|
Number getAngularDamping();
|
|
|
Number getFriction();
|
|
|
@@ -84,7 +91,6 @@ namespace Polycode {
|
|
|
/**
|
|
|
* Sets physics entity density
|
|
|
*/
|
|
|
-
|
|
|
void setDensity(Number density);
|
|
|
Number getDensity();
|
|
|
|
|
|
@@ -94,14 +100,12 @@ namespace Polycode {
|
|
|
* Collision mask specifies which bits the physics entity will collide with. default 65535 (or 0xFFFF, or "1111111111111111", or everything)
|
|
|
* If a physics entity's mask bits don't line up with any of an overlapping entity's category bits, their collisions will be skipped
|
|
|
*/
|
|
|
-
|
|
|
void setCollisionCategory(int categoryBits);
|
|
|
void setCollisionMask(int maskBits);
|
|
|
-
|
|
|
void setCollisionGroupIndex(int group);
|
|
|
|
|
|
/**
|
|
|
- * Gets a specific fixture via it's index position
|
|
|
+ * Gets a specific fixture based on it's index position
|
|
|
*/
|
|
|
b2Fixture* getFixture(unsigned short index);
|
|
|
/**
|
|
|
@@ -118,12 +122,15 @@ namespace Polycode {
|
|
|
*/
|
|
|
static const int ENTITY_CIRCLE = 2;
|
|
|
/**
|
|
|
- * Mesh entity.
|
|
|
+ * Mesh physics entity.
|
|
|
*/
|
|
|
static const int ENTITY_MESH = 3;
|
|
|
-
|
|
|
+ /**
|
|
|
+ * Edge phyiscs Entity
|
|
|
+ */
|
|
|
static const int ENTITY_EDGE = 4;
|
|
|
|
|
|
+
|
|
|
b2Body *body;
|
|
|
b2Fixture *fixture;
|
|
|
|
|
|
@@ -131,8 +138,8 @@ namespace Polycode {
|
|
|
|
|
|
protected:
|
|
|
|
|
|
- Number worldScale;
|
|
|
- ScreenEntity *screenEntity;
|
|
|
+ Number worldScale;
|
|
|
+ ScreenEntity *screenEntity;
|
|
|
};
|
|
|
|
|
|
}
|