SDK 6.3/PAWN/Physics
Jump to navigation
Jump to search
Official WOWCube SDK documentation. SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.
Contents
Data structures
PHYSICS_CIRCLE_DATA
Syntax:
#define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .module, .screen, .moduleT, .screenT,
Description:
- Array with named fields which represents a round object.
- Fields:
- posX - circle position on X axis (fixed point)
- posY - circle position on Y axis (fixed point)
- simplePosX - circle position on X axis
- simplePosY - circle position on Y axis
- spdX - circle X speed
- spdY - circle Y speed
- mass - circle mass (fixed point)
- radius - circle radius
- CoR - Coefficient of restitution (fixed point)
- module - module owner of this circle
- screen - screen owner of this circle
- moduleT - module transfer, last module owner. Can be used for resending messages
- screenT - screen transfer, last screen owner. Can be used for resending messages
Functions
Physics_Overlap
Syntax:
stock Physics_Overlap(overlap, positionDifference, distance)
Description:
- TBD: inner function
Physics_Circle_Vs_Circle_obj
Syntax:
stock Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])
Description:
- Check if there is a collision between two round objects.
Arguments:
- circle1, circle2
- objects for whom collision is checked
Return values:
- True if collision happens, false otherwise.
See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless()
Physics_Circle_vs_AABB_obj
Syntax:
stock Physics_Circle_vs_AABB_obj(circle[PHYSICS_CIRCLE_DATA], rectX, rectY, rectWidth, rectHeight, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)
Description:
- Check if there is a collision between round object and the axis-aligned
- bounding box.
Arguments:
- circle
- an object for whom collision is checked
- rectX, rectY,
- coordinates of the AABB object
- rectWidth, rectHeight
- dimensions of the AABB object
- Outputs
- fakeCircle
- collision point, can be used for resolving collision
Return values:
- True if collision happens, false otherwise.
See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless()
Physics_Circle_Vs_LineSegment
Syntax:
stock Physics_Circle_Vs_LineSegment(circle[PHYSICS_CIRCLE_DATA], lineSX, lineSY, lineEX, lineEY, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)
Description:
- Check if there is a collision between round object and the line.
Arguments:
- circle
- an object for whom collision is checked
- lineSX, lineSY, lineEX, lineEY
- the line start and end coordinates
- Outputs
- fakeCircle
- collision point, can be used for resolving collision
Return values:
- True if collision happens, false otherwise.
See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless()
Physics_Res_CvC_Coll_Massless
Syntax:
stock Physics_Res_CvC_Coll_Massless(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])
Description:
- Resolve collision without mass.
See also: Physics_Res_CvC_Coll_Mass()
Physics_Res_CvC_Coll_Mass
Syntax:
stock Physics_Res_CvC_Coll_Mass(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])
Description:
- Resolve collision with mass
See also: Physics_Res_CvC_Coll_Massless()
Physics_DeserializeCircle
Syntax:
stock Physics_DeserializeCircle(serializedData_1, serializedData_2, circle[PHYSICS_CIRCLE_DATA])
Description:
- Deserialize circle object data received from network.
Arguments:
- serializedData_1, serializedData_2
- data to deserialize
- Outputs
- circle
- deserialized data
See also: Physics_SerializeCircle(), ON_Message()
Physics_SerializeCircle
Syntax:
stock Physics_SerializeCircle(obj[PHYSICS_CIRCLE_DATA], &serializedData_1, &serializedData_2)
Description:
- Serialize circle object data to send it over network.
Arguments:
- obj
- an object to serialize
- Outputs
- serializedData_1, serializedData_2
- serialized data
See also: Physics_DeserializeCircle(), broadcastMessage()