Class EB.Prediction.Position.Collision
Computes collision between objects.
Inheritance
Inherited Members
Namespace: Oasys.Common.Logic
Assembly: Oasys.Common.dll
Syntax
public static class Collision
Methods
CircularMissileCollision(GameObjectBase, Vector2, Vector2, Single, Int32, Int32, Int32)
Determines whether a unit will collide with a circular missile along a predetermined path. Circular missiles cause collision only at the destination point.
Declaration
public static bool CircularMissileCollision(GameObjectBase unit, Vector2 missileStartPos, Vector2 missileEndPos, float missileSpeed, int missileRadius, int delay, int extraRadius = 0)
Parameters
Type | Name | Description |
---|---|---|
GameObjectBase | unit | The unit to check collision. |
SharpDX.Vector2 | missileStartPos | The starting point of the missile. |
SharpDX.Vector2 | missileEndPos | The destination point of the missile. |
System.Single | missileSpeed | Missile's speed. |
System.Int32 | missileRadius | Missile's collision radius. |
System.Int32 | delay | The time (in milliseconds) it will take for the missile to spawn. |
System.Int32 | extraRadius | The extra hitbox radius you can assign to the unit. Default value: 0. |
Returns
Type | Description |
---|---|
System.Boolean |
GetCollisionPoint(Vector2, Vector2, Vector2, Single, Single)
Computes the point where an object can collide with another object moving along a predetermined path. There may not always exist a valid point.
Declaration
public static Vector2 GetCollisionPoint(Vector2 start, Vector2 end, Vector2 position, float speed, float speed2)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.Vector2 | start | The starting point of the pretedermined path. |
SharpDX.Vector2 | end | The ending point of the predetermined path. |
SharpDX.Vector2 | position | The current position of the object. |
System.Single | speed | The movement speed of the object moving along the predetermined path. |
System.Single | speed2 | The movement speed of the object. |
Returns
Type | Description |
---|---|
SharpDX.Vector2 |
GetYasuoWallCollision(Vector3, Vector3)
Returns the point that intersects with Start and End, returns Vector3.Zero if doesn't collide.
Declaration
public static Vector3 GetYasuoWallCollision(Vector3 start, Vector3 end)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.Vector3 | start | The start point. |
SharpDX.Vector3 | end | The end point. |
Returns
Type | Description |
---|---|
SharpDX.Vector3 |
LinearMissileCollision(GameObjectBase, Vector2, Vector2, Single, Int32, Int32, Int32)
Determines whether a unit will collide with a linear missile along a predetermined path.
Declaration
public static bool LinearMissileCollision(GameObjectBase unit, Vector2 missileStartPos, Vector2 missileEndPos, float missileSpeed, int missileWidth, int delay, int extraRadius = 0)
Parameters
Type | Name | Description |
---|---|---|
GameObjectBase | unit | The unit to check collision. |
SharpDX.Vector2 | missileStartPos | The starting point of the missile. |
SharpDX.Vector2 | missileEndPos | The destination point of the missile. |
System.Single | missileSpeed | Missile's speed. |
System.Int32 | missileWidth | Missile's width. The width is equal to the double of the missile's hitbox radius. |
System.Int32 | delay | The time (in milliseconds) it will take for the missile to spawn. |
System.Int32 | extraRadius | The extra hitbox radius you can assign to the unit. Default value: 0. |
Returns
Type | Description |
---|---|
System.Boolean |
MovingObjectsCollision(Vector2, Vector2, Single, Single, Boolean, Vector2, Vector2, Single, Single, Boolean)
Determines whether two moving objects will collide within a predetermined path. The movement is considered linear.
Declaration
public static bool MovingObjectsCollision(Vector2 start, Vector2 destination, float hitbox, float speed, bool isUnit, Vector2 start2, Vector2 destination2, float hitbox2, float speed2, bool isUnit2)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.Vector2 | start | The starting point of the first object. |
SharpDX.Vector2 | destination | The destination point of the first object. |
System.Single | hitbox | The hitbox radius of the first object. |
System.Single | speed | The movement speed of the first object. |
System.Boolean | isUnit | Determines whether the object is a unit. Set to true if the first object disappears after reaching its destination. |
SharpDX.Vector2 | start2 | The starting point of the second object. |
SharpDX.Vector2 | destination2 | The destination point of the second object. |
System.Single | hitbox2 | The hitbox radius of the second object. |
System.Single | speed2 | The movement speed of the second object. |
System.Boolean | isUnit2 | Determines whether the object is a unit. Set to true if the second object disappears after reaching its destination. |
Returns
Type | Description |
---|---|
System.Boolean |