public override Collision Collide(Collider other) { var sc = other as SphereCollider; if (sc != null) return _SphereCollide(sc); return base.Collide(other); }
public override Boolean Collides(Collider other) { var sc = other as SphereCollider; if (sc != null) return TgcCollisionUtils.testSphereSphere(this.Sphere, sc.Sphere); return base.Collides(other); }
public Collision(Collider colliderA, Collider colliderB, params Contact[] contacts) { ColliderA = colliderA; ColliderB = colliderB; Contacts = contacts; Friction = colliderA.Friction + colliderB.Friction; Restitution = Math.Max(colliderA.Restitution, colliderB.Restitution); }
public Portal() { var mesh = Game.Current.NewMesh("BallTextured"); Add(_PartList[0] = new MeshStaticPart(mesh) { Texture = Game.Current.GetMaterial("BluePortal.png") }); _PartList[1] = _Collider = new ObbCollider(mesh); Add(_Collider); var receptorMesh = Game.Current.NewMesh("BallTextured"); Add(_PartList[2] = _Receptor = new MeshImmutableePart(receptorMesh) { Texture = Game.Current.GetMaterial("OrangePortal.png") }); _SoundEffect = Game.Current.GetSound("Portal.wav", EffectVolume); }
public override Boolean Collides(Collider other) { var sc = other as SphereCollider; if (sc != null) return TgcCollisionUtils.testSphereOBB(sc.Sphere, Obb); var oc = other as ObbCollider; if (oc != null) return TgcCollisionUtils.testObbObb(oc.Obb, Obb); return base.Collides(other); }
public Collider Remove(Collider collider) { _Colliders.Remove(collider); Remove(collider as ItemPart); return collider; }
public Collider Add(Collider collider) { _Colliders.Add(collider); Add(collider as ItemPart); return collider; }
public virtual Boolean Collides(Collider other) { return other.Collides(this); }
public virtual Collision Collide(Collider other) { var c = other.Collide(this); c.Invert(); return c; }