Constructor
new CollisionInfo() → {CollisionInfo}
- Source:
Returns:
a new CollisionInfo instance
- Type
- CollisionInfo
Methods
changeDir()
Reverses the direction of the interpenetration resolution this CollisionInfo encapsulates
- Source:
draw(aCamera)
Draw a line on aCamera that shows this CollisionInfo
Parameters:
| Name | Type | Description |
|---|---|---|
aCamera |
Camera | the Camera to draw to |
- Source:
getDepth() → {float}
Returns the interpenetration depth between the colliding shapes
- Source:
Returns:
mDepth - interpenetration depth
- Type
- float
getEnd() → {vec2}
Returns the ending [X,Y] position for this CollisionInfo
- Source:
Returns:
mEnd - ending position
- Type
- vec2
getNormal() → {vec2}
Returns the normal vector for this CollisionInfo
- Source:
Returns:
mNormal - the normal vector
- Type
- vec2
getStart() → {vec2}
Returns the starting [X,Y] position for this CollisionInfo
- Source:
Returns:
mStart - starting position
- Type
- vec2
setDepth(s)
Sets the interpenetration depth between the colliding shapes
Parameters:
| Name | Type | Description |
|---|---|---|
s |
float | the new interpenetration depth |
- Source:
setInfo(d, n, s)
Sets all the properties that describe this CollisionInfo.
Calculates ending position based on starting position, normal vector, and depth
Parameters:
| Name | Type | Description |
|---|---|---|
d |
float | the depth of interpenetration between the shapes |
n |
vec2 | the normal vector for the collision |
s |
vec2 | the [X,Y] starting position in world coordinates |
- Source:
setNormal(s)
Sets the normal vector for this CollisionInfo
Parameters:
| Name | Type | Description |
|---|---|---|
s |
vec2 | the new normal vector |
- Source: