public static Fix64Vec3 MulT(Fix64Vec3 pos, Fix64Quat rot, Fix64Vec3 point) { Fix64Vec3 output = Fix64Vec3.zero; NativeParallel3D.MulT(pos, rot, point, ref output); return(output); }
public Fix64 Length() { Fix64 result = Fix64.zero; NativeParallel3D.Vec3Length64(this, ref result); return(result); }
public static bool OverlapCube(Fix64Vec3 center, Fix64Quat rotation, Fix64 x, Fix64 y, Fix64 z, int mask, PShapeOverlapResult3D shapeOverlapResult) { if (!initialized) { Initialize(); } int count = 0; bool hit = NativeParallel3D.CubeOverlap(internalWorld.IntPointer, mask, center, rotation, x, y, z, _queryBodyIDs, ref count); shapeOverlapResult.count = count; for (int i = 0; i < count; i++) { UInt16 bodyID = _queryBodyIDs[i]; if (bodyDictionary.ContainsKey(bodyID)) { shapeOverlapResult.rigidbodies[i] = bodyDictionary[bodyID].RigidBody; } else { Debug.LogError($"Rigibody not found: {bodyID}"); } } return(hit); }
public static ParallelQHullData ConvextHull3D(Fix64Vec3[] verts, UInt32 count, bool simplify, Fix64 rad) { if (!initialized) { Initialize(); } UInt32 outCount = 1024 * 10; Fix64Vec3[] vertsOut = new Fix64Vec3[outCount]; ParallelEdge[] edgesOut = new ParallelEdge[outCount]; ParallelFace[] facesOut = new ParallelFace[outCount]; ParallelPlane[] planesOut = new ParallelPlane[outCount]; UInt32 vertsOutCount = outCount; UInt32 edgesOutCount = outCount; UInt32 facesOutCount = outCount; NativeParallel3D.ConvexHull3D(verts, count, vertsOut, ref vertsOutCount, edgesOut, ref edgesOutCount, facesOut, ref facesOutCount, planesOut, simplify, rad); ParallelQHullData parallelQHullData = new ParallelQHullData(); parallelQHullData.vertexCount = vertsOutCount; parallelQHullData.edgeCount = edgesOutCount; parallelQHullData.faceCount = facesOutCount; parallelQHullData.vertices = vertsOut; parallelQHullData.edges = edgesOut; parallelQHullData.faces = facesOut; parallelQHullData.planes = planesOut; return(parallelQHullData); }
public static void SetFixtureProperties(PFixture3D fixture, bool isTrigger, Fix64 friction, Fix64 bounciness) { if (!initialized) { Initialize(); } NativeParallel3D.SetFixtureProperties(fixture.IntPointer, isTrigger, friction, bounciness); }
public static void UpdateCube(PShape3D shape, PFixture3D fixture, Fix64 x, Fix64 y, Fix64 z, Fix64Vec3 center, Fix64Quat rotation) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateCube(shape.IntPointer, fixture.IntPointer, x, y, z, center, rotation); }
public static void UpdateBodyVelocity(PBody3D body, Fix64Vec3 linearVelocity, Fix64Vec3 angularVelocity) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateBodyVelocity(body.IntPointer, linearVelocity, angularVelocity); }
public static void UpdateBodyTransformForRollback(PBody3D body, Fix64Vec3 pos, Fix64Quat rot, Fix64Quat rot0) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateBodyTransformForRollback(body.IntPointer, pos, rot, rot0); }
public static void UpdateSphere(PShape3D shape, PFixture3D fixture, Fix64 radius, Fix64Vec3 center) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateSphere(shape.IntPointer, fixture.IntPointer, radius, center); }
public static void ApplyForceToCenter(PBody3D body, Fix64Vec3 force) { if (!initialized) { Initialize(); } NativeParallel3D.ApplyForceToCenter(body.IntPointer, force); }
public static void ApplyAngularImpulse(PBody3D body, Fix64Vec3 impulse) { if (!initialized) { Initialize(); } NativeParallel3D.ApplyAngularImpulse(body.IntPointer, impulse); }
public static void UpdateMassData(PBody3D body, Fix64 mass, Fix64Vec3 centerOfMass) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateMassData(body.IntPointer, mass, centerOfMass); }
public static void SetAwakeForRollback(PBody3D body, bool awake, Fix64 sleepTime) { if (!initialized) { Initialize(); } NativeParallel3D.SetAwakeForRollback(body.IntPointer, awake, sleepTime); }
public static void GetWorldSize(ref Fix64Vec3 lower, ref Fix64Vec3 uppder) { if (!initialized) { Initialize(); } NativeParallel3D.GetWorldSize(internalWorld.IntPointer, ref lower, ref uppder); }
public static void SetAwake(PBody3D body, bool awake) { if (!initialized) { Initialize(); } NativeParallel3D.SetAwake(body.IntPointer, awake); }
public static void UpdateMesh(PShape3D shape, PFixture3D fixture, Fix64Vec3 scale) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateMesh(shape.IntPointer, fixture.IntPointer, scale); }
public static bool IsAwake(PBody3D body) { if (!initialized) { Initialize(); } return(NativeParallel3D.IsAwake(body.IntPointer)); }
public static void UpdateCapsule(PShape3D shape, PFixture3D fixture, Fix64Vec3 v1, Fix64Vec3 v2, Fix64 radius, Fix64Vec3 center, Fix64Quat rotation) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateCapsule(shape.IntPointer, fixture.IntPointer, v1, v2, radius, center, rotation); }
public static void ConvextHull3D1(Vector3[] verts, UInt32 count) { if (!initialized) { Initialize(); } NativeParallel3D.ConvexHull3D1(verts, count); }
public static void ApplyTorque(PBody3D body, Fix64Vec3 torque) { if (!initialized) { Initialize(); } NativeParallel3D.ApplyTorque(body.IntPointer, torque); }
public static void UpdateMass(PBody3D body, Fix64 mass) { if (!initialized) { Initialize(); } NativeParallel3D.UpdateMass(body.IntPointer, mass); }
public static void AddExternalConvexCache(PInternalState3D state) { for (int i = 0; i < state.contactCount; i++) { PContactExport3D export = state.contactExports[i]; PConvexCacheExport3D convexExport = state.convexExports[i]; NativeParallel3D.AddExternalConvexCacheData(export.id, convexExport); } }
public static PShape3D CreateSphere(Fix64 radius, Fix64Vec3 center) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.CreateSphere(radius, center); return(new PShape3D(m_NativeObject)); }
//3D fixture public static PFixture3D AddFixture(PBody3D body, PShape3D shape, Fix64 density) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.AddFixtureToBody(body.IntPointer, shape.IntPointer, density); return(new PFixture3D(m_NativeObject)); }
public static PShape3D CreateCapsule(Fix64Vec3 v1, Fix64Vec3 v2, Fix64 radius, Fix64Vec3 center, Fix64Quat rotation) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.CreateCapsule(v1, v2, radius, center, rotation); return(new PShape3D(m_NativeObject)); }
public static PShape3D CreatePolyhedron(ParallelQHullData parallelQHullData, Fix64Vec3 scale, Fix64Vec3 center, Fix64Quat rotation) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.CreateConvex(parallelQHullData.vertices, parallelQHullData.vertexCount, parallelQHullData.edges, parallelQHullData.edgeCount, parallelQHullData.faces, parallelQHullData.faceCount, parallelQHullData.planes, scale, center, rotation); return(new PShape3D(m_NativeObject)); }
public static PShape3D CreateMesh(ParallelMeshData parallelMeshData, Fix64Vec3 scale) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.CreateMesh(parallelMeshData.vertices, parallelMeshData.vertexCount, parallelMeshData.triangles, parallelMeshData.triangleCount, scale); return(new PShape3D(m_NativeObject)); }
//3D shapes public static PShape3D CreateCube(Fix64 x, Fix64 y, Fix64 z, Fix64Vec3 center, Fix64Quat rotation) { if (!initialized) { Initialize(); } IntPtr m_NativeObject = NativeParallel3D.CreateCube(x, y, z, center, rotation); return(new PShape3D(m_NativeObject)); }
public static void ReadNativeBody(PBody3D body) { if (!initialized) { Initialize(); } NativeParallel3D.GetTransform(body.IntPointer, ref body.position, ref body.orientation, ref body.orientation0); NativeParallel3D.GetVelocity(body.IntPointer, ref body.linearVelocity, ref body.angularVelocity); body.awake = NativeParallel3D.IsAwake(body.IntPointer); NativeParallel3D.GetSleepTime(body.IntPointer, ref body.sleepTime); }
public static Fix64Vec3 GetPointVelocity(PBody3D body, Fix64Vec3 point) { if (!initialized) { Initialize(); } Fix64Vec3 result = Fix64Vec3.zero; NativeParallel3D.GetPointVelocity(body.IntPointer, point, ref result); return(result); }