Universe.Physics.BulletSPlugin.BSAPIXNA.CreateGhostFromShape C# (CSharp) Method

CreateGhostFromShape() public method

public CreateGhostFromShape ( BulletWorld pWorld, BulletShape pShape, uint pLocalID, System.Vector3 pRawPosition, Quaternion pRawOrientation ) : BulletBody
pWorld BulletWorld
pShape BulletShape
pLocalID uint
pRawPosition System.Vector3
pRawOrientation Quaternion
return BulletBody
        public override BulletBody CreateGhostFromShape(BulletWorld pWorld, BulletShape pShape, uint pLocalID,
            Vector3 pRawPosition, Quaternion pRawOrientation)
        {
            // 20131224 not used        DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world;
            IndexedMatrix bodyTransform = new IndexedMatrix();
            bodyTransform._origin = new IndexedVector3(pRawPosition.X, pRawPosition.Y, pRawPosition.Z);
            bodyTransform.SetRotation(new IndexedQuaternion(pRawOrientation.X, pRawOrientation.Y, pRawOrientation.Z,
                pRawOrientation.W));
            GhostObject gObj = new PairCachingGhostObject();
            gObj.SetWorldTransform(bodyTransform);
            CollisionShape shape = (pShape as BulletShapeXNA).shape;
            gObj.SetCollisionShape(shape);
            gObj.SetUserPointer(pLocalID);

            if (specialCollisionObjects.ContainsKey(pLocalID))
                specialCollisionObjects[pLocalID] = gObj;
            else
                specialCollisionObjects.Add(pLocalID, gObj);

            // TODO: Add to Special CollisionObjects!
            return new BulletBodyXNA(pLocalID, gObj);
        }
BSAPIXNA