/// <summary>Called when we collide with another object.</summary> /// <description> /// /// </description> /// <param name="obj">The ShapeBase object</param> /// <param name="collObj">The object we collided with</param> /// <param name="vec">Collision impact vector</param> /// <param name="len">Length of the impact vector</param> public virtual void OnCollision(ShapeBase obj, SceneObject collObj, Point3F vec, float len) { vec.Alloc(); InternalUnsafeMethods.OnCollision__Args _args = new InternalUnsafeMethods.OnCollision__Args() { obj = obj.ObjectPtr, collObj = collObj.ObjectPtr, vec = vec.internalStructPtr, len = len, }; InternalUnsafeMethods.OnCollision()(ObjectPtr, _args); vec.Free(); }
/// <summary>Called when a projectile collides with another object.</summary> /// <description> /// This function is only called on server objects. /// </description> /// <param name="proj">The projectile colliding with SceneObject col.</param> /// <param name="col">The SceneObject hit by the projectile.</param> /// <param name="fade">The current fadeValue of the projectile, affects its visibility.</param> /// <param name="pos">The position of the collision.</param> /// <param name="normal">The normal of the collision.</param> /// <see cref="Projectile" /> public virtual void OnCollision(Projectile proj, SceneObject col, float fade, Point3F pos, Point3F normal) { pos.Alloc(); normal.Alloc(); InternalUnsafeMethods.OnCollision__Args _args = new InternalUnsafeMethods.OnCollision__Args() { proj = proj.ObjectPtr, col = col.ObjectPtr, fade = fade, pos = pos.internalStructPtr, normal = normal.internalStructPtr, }; InternalUnsafeMethods.OnCollision()(ObjectPtr, _args); pos.Free(); normal.Free(); }