示例#1
0
        public Vector3 GetPosition(IPhysicsObject physObj)
        {
            if (!objectIDs.ContainsKey(physObj))
            {
                return(Vector3.Zero);
            }

            float[] position = new float[3];
            HavokDllBridge.get_body_position(objectIDs[physObj], position);
            return(Vector3Helper.FromFloats(position));
        }
示例#2
0
        public BoundingBox GetAxisAlignedBoundingBox(IPhysicsObject physObj)
        {
            if (!objectIDs.ContainsKey(physObj))
            {
                return(new BoundingBox());
            }

            float[] min = new float[3];
            float[] max = new float[3];
            HavokDllBridge.get_AABB(objectIDs[physObj], min, max);
            Vector3Helper.FromFloats(min, out tmpVec1);
            Vector3Helper.FromFloats(max, out tmpVec2);

            return(new BoundingBox(tmpVec1, tmpVec2));
        }