Difference between revisions of "SDK 6.3/PAWN/Physics"
(Official WOWCube SDK 6.3 documentation (automated publish from SDK headers)) |
(Mark PAWN API as legacy (supported, not developed) (WowBot)) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{notice|'''Official WOWCube SDK documentation.''' SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.}} | {{notice|'''Official WOWCube SDK documentation.''' SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.}} | ||
| + | {{notice|'''Legacy track.''' The PAWN API is supported but no longer actively developed — the last PAWN additions shipped in SDK 6.2. New development uses the [[SDK 6.3/C++/Native API|C++ (WebAssembly) API]].}} | ||
| + | |||
| + | {{SDK 6.3 nav}} | ||
| + | |||
| + | ''← [[SDK 6.3]] · PAWN / Physics'' | ||
==Data structures== | ==Data structures== | ||
| Line 47: | Line 52: | ||
: True if collision happens, false otherwise. | : True if collision happens, false otherwise. | ||
| − | See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless() | + | See also: [[#Physics_Res_CvC_Coll_Mass|Physics_Res_CvC_Coll_Mass()]], [[#Physics_Res_CvC_Coll_Massless|Physics_Res_CvC_Coll_Massless()]] |
===Physics_Circle_vs_AABB_obj=== | ===Physics_Circle_vs_AABB_obj=== | ||
| Line 71: | Line 76: | ||
: True if collision happens, false otherwise. | : True if collision happens, false otherwise. | ||
| − | See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless() | + | See also: [[#Physics_Res_CvC_Coll_Mass|Physics_Res_CvC_Coll_Mass()]], [[#Physics_Res_CvC_Coll_Massless|Physics_Res_CvC_Coll_Massless()]] |
===Physics_Circle_Vs_LineSegment=== | ===Physics_Circle_Vs_LineSegment=== | ||
| Line 92: | Line 97: | ||
: True if collision happens, false otherwise. | : True if collision happens, false otherwise. | ||
| − | See also: Physics_Res_CvC_Coll_Mass(), Physics_Res_CvC_Coll_Massless() | + | See also: [[#Physics_Res_CvC_Coll_Mass|Physics_Res_CvC_Coll_Mass()]], [[#Physics_Res_CvC_Coll_Massless|Physics_Res_CvC_Coll_Massless()]] |
===Physics_Res_CvC_Coll_Massless=== | ===Physics_Res_CvC_Coll_Massless=== | ||
| Line 101: | Line 106: | ||
: Resolve collision without mass. | : Resolve collision without mass. | ||
| − | See also: Physics_Res_CvC_Coll_Mass() | + | See also: [[#Physics_Res_CvC_Coll_Mass|Physics_Res_CvC_Coll_Mass()]] |
===Physics_Res_CvC_Coll_Mass=== | ===Physics_Res_CvC_Coll_Mass=== | ||
| Line 110: | Line 115: | ||
: Resolve collision with mass | : Resolve collision with mass | ||
| − | See also: Physics_Res_CvC_Coll_Massless() | + | See also: [[#Physics_Res_CvC_Coll_Massless|Physics_Res_CvC_Coll_Massless()]] |
===Physics_DeserializeCircle=== | ===Physics_DeserializeCircle=== | ||
| Line 126: | Line 131: | ||
:: deserialized data | :: deserialized data | ||
| − | See also: Physics_SerializeCircle(), ON_Message() | + | See also: [[#Physics_SerializeCircle|Physics_SerializeCircle()]], ON_Message() |
===Physics_SerializeCircle=== | ===Physics_SerializeCircle=== | ||
| Line 142: | Line 147: | ||
:: serialized data | :: serialized data | ||
| − | See also: Physics_DeserializeCircle(), broadcastMessage() | + | See also: [[#Physics_DeserializeCircle|Physics_DeserializeCircle()]], broadcastMessage() |
[[Category:SDK 6.3]] | [[Category:SDK 6.3]] | ||
[[Category:PAWN API]] | [[Category:PAWN API]] | ||
Latest revision as of 09:45, 26 July 2026
SDK 6.3 · PAWN API: Core ·
Graphics ·
Topology ·
Sound ·
Motion Sensor ·
Leaderboard ·
Splash Screen ·
Physics ·
Network ·
Save ·
Scramble ·
Logging
C++: Native API · Application · GFX Engine · Rust: Rust API (experimental) · Changelog
← SDK 6.3 · PAWN / Physics
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()