private void ExplosionCallback( VoltRayCast rayCast, VoltRayResult rayResult, Fix64 rayWeight) { VoltVector2 point = rayResult.ComputePoint(ref rayCast); this.hits.Add(point.ToVector()); }
public override VoltShape PrepareShape(VoltWorld world) { VoltVector2[] vertices = new VoltVector2[this.points.Length]; for (int i = 0; i < this.points.Length; i++) { vertices[i] = this.points[i].position.ToFixed(); } this.shape = world.CreatePolygonWorldSpace( vertices, this.density.ToFixed()); return(this.shape); }
public static Vector2 ToVector(this VoltVector2 vec) { return(new Vector2((float)vec.x, (float)vec.y)); }