private void SetPlanes() { _xyzPlane = new Plane(Vector3.One.Normalized, -CrossInner / MathF.Sqrt(3)); _xyPlane = new Plane(Vector3.UnitZ, 0); _xzPlane = new Plane(Vector3.UnitY, 0); _yzPlane = new Plane(Vector3.UnitX, 0); _xBox = new Box(new Vector3(0.5f, 0, 0), new Vector3(1, ColliderWidth, ColliderWidth)); _yBox = new Box(new Vector3(0, 0.5f, 0), new Vector3(ColliderWidth, 1, ColliderWidth)); _zBox = new Box(new Vector3(0, 0, 0.5f), new Vector3(ColliderWidth, ColliderWidth, 1)); }
private void AddColliders() { _xBox = new Box(new Vector3(0.5f, 0, 0), new Vector3(1, ColliderWidth, ColliderWidth)); _yBox = new Box(new Vector3(0, 0.5f, 0), new Vector3(ColliderWidth, 1, ColliderWidth)); _zBox = new Box(new Vector3(0, 0, 0.5f), new Vector3(ColliderWidth, ColliderWidth, 1)); var offset = CrossMid - CrossSize / 2; _xyBox = new Box(new Vector3(offset, offset, 0), new Vector3(CrossSize, CrossSize, 0)); _xzBox = new Box(new Vector3(offset, 0, offset), new Vector3(CrossSize, 0, CrossSize)); _yzBox = new Box(new Vector3(0, offset, offset), new Vector3(0, CrossSize, CrossSize)); }