Permalink
Browse files

added some property to AWPCollisionObject

  • Loading branch information...
1 parent 2dff602 commit 6db0dedf47c03095707d4b34a6585b09c89191db @muzerly muzerly committed Sep 8, 2011
@@ -20,6 +20,7 @@ package awayphysics.collision.dispatch {
public static var WANTS_DEACTIVATION : int = 3;
public static var DISABLE_DEACTIVATION : int = 4;
public static var DISABLE_SIMULATION : int = 5;
+
private var m_shape : AWPShape;
private var m_skin : ObjectContainer3D;
private var m_worldTransform : AWPTransform;
@@ -33,7 +34,7 @@ package awayphysics.collision.dispatch {
m_skin = skin;
pointer = ptr;
-
+
m_worldTransform = new AWPTransform(ptr + 4);
m_anisotropicFriction = new AWPVector3(ptr + 164);
@@ -190,6 +191,46 @@ package awayphysics.collision.dispatch {
public function get isActive() : Boolean {
return (activationState != AWPCollisionObject.ISLAND_SLEEPING && activationState != AWPCollisionObject.DISABLE_SIMULATION);
}
+
+ /**
+ * reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
+ * the values defined by AWPCollisionObjectTypes
+ */
+ public function get internalType() : int {
+ return memUser._mr32(pointer + 232);
+ }
+
+ public function get hitFraction() : Number {
+ return memUser._mrf(pointer + 240);
+ }
+
+ public function set hitFraction(v : Number) : void {
+ memUser._mwf(pointer + 240, v);
+ }
+
+ public function get ccdSweptSphereRadius() : Number {
+ return memUser._mrf(pointer + 244);
+ }
+
+ /**
+ * used to motion clamping
+ * refer to http://bulletphysics.org/mediawiki-1.5.8/index.php/Anti_tunneling_by_Motion_Clamping
+ */
+ public function set ccdSweptSphereRadius(v : Number) : void {
+ memUser._mwf(pointer + 244, v);
+ }
+
+ public function get ccdMotionThreshold() : Number {
+ return memUser._mrf(pointer + 248);
+ }
+
+ /**
+ * used to motion clamping
+ * refer to http://bulletphysics.org/mediawiki-1.5.8/index.php/Anti_tunneling_by_Motion_Clamping
+ */
+ public function set ccdMotionThreshold(v : Number) : void {
+ memUser._mwf(pointer + 248, v);
+ }
public function addEventListener(type : String, listener : Function, useCapture : Boolean = false, priority : int = 0, useWeakReference : Boolean = false) : void {
this.collisionFlags |= AWPCollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK;
@@ -0,0 +1,10 @@
+package awayphysics.data {
+ public class AWPCollisionObjectTypes {
+ public static var CO_COLLISION_OBJECT : int = 1;
+ public static var CO_RIGID_BODY : int = 2;
+ public static var CO_GHOST_OBJECT : int = 4;
+ public static var CO_SOFT_BODY : int = 8;
+ public static var CO_HF_FLUID : int = 16;
+ public static var CO_USER_TYPE : int = 32;
+ }
+}
@@ -18,7 +18,7 @@ package awayphysics.dynamics {
public static function getInstance() : AWPDynamicsWorld {
if (!currentDynamicsWorld) {
- trace("version: AwayPhysics v0.63 (7-9-2011)");
+ trace("version: AwayPhysics v0.63 (8-9-2011)");
currentDynamicsWorld = new AWPDynamicsWorld();
}
return currentDynamicsWorld;

0 comments on commit 6db0ded

Please sign in to comment.