public Collider(UnityEngine.Collider source, ShapeType shapeType, int shapeIndex, int rigidbodyIndex, int materialIndex) { bounds = new Oni.Bounds(source.bounds.min, source.bounds.max); translation = source.transform.position; rotation = source.transform.rotation; inverse_rotation = Quaternion.Inverse(source.transform.rotation); scale = source.transform.lossyScale; contactOffset = source.contactOffset; this.collisionGroup = source.gameObject.layer; this.shapeType = shapeType; this.shapeIndex = shapeIndex; this.rigidbodyIndex = rigidbodyIndex; this.materialIndex = materialIndex; }
public Collider(UnityEngine.Collider2D source, ShapeType shapeType, float thickness, int shapeIndex, int rigidbodyIndex, int materialIndex) { bounds = new Oni.Bounds(source.bounds.min - Vector3.one * (thickness + 0.01f), //allow some room for contacts to be generated before penetration. source.bounds.max + Vector3.one * (thickness + 0.01f)); translation = source.transform.position; rotation = source.transform.rotation; inverse_rotation = Quaternion.Inverse(source.transform.rotation); scale = new Vector4(source.transform.lossyScale.x, source.transform.lossyScale.y, source.transform.lossyScale.z, 1); contactOffset = thickness; this.collisionGroup = source.gameObject.layer; this.shapeType = shapeType; this.shapeIndex = shapeIndex; this.rigidbodyIndex = rigidbodyIndex; this.materialIndex = materialIndex; }
public void EndFrame(float frameDelta) { foreach (ObiActor actor in actors) { actor.OnSolverPreInterpolation(); } Oni.ApplyPositionInterpolation(oniSolver, frameDelta); Oni.GetBounds(oniSolver, boundsHandle.AddrOfPinnedObject()); bounds = (Oni.Bounds)boundsHandle.Target; //TODO: why is this needed, if memory is shared? CheckVisibility(); if (OnBeforeActorsFrameEnd != null) { OnBeforeActorsFrameEnd(this, null); } foreach (ObiActor actor in actors) { actor.OnSolverFrameEnd(); } }