Convenience wrapper for constructing EnvironmentalBoundary-based obstacles.
More...
#include <obstacle.hpp>
|
| static FieldObstacle | makePlane (const Vector3 &point_m, const Quaternion &orientation, double restitution=0.3, double friction=0.6, int user_id=0) |
| | Creates an infinite plane obstacle.
|
| static FieldObstacle | makeBox (const Vector3 ¢er_m, const Vector3 &half_extents_m, const Quaternion &orientation=Quaternion(), double restitution=0.3, double friction=0.6, int user_id=0) |
| | Creates an oriented box obstacle.
|
| static FieldObstacle | makeCylinder (const Vector3 ¢er_m, double radius_m, double half_height_m, const Quaternion &orientation=Quaternion(), double restitution=0.3, double friction=0.6, int user_id=0) |
| | Creates an oriented cylinder obstacle aligned to local Z.
|
Convenience wrapper for constructing EnvironmentalBoundary-based obstacles.
◆ makeBox()
Creates an oriented box obstacle.
- Parameters
-
| center_m | Box center in world coordinates. |
| half_extents_m | Positive half-lengths along local X/Y/Z axes. |
| orientation | Box orientation quaternion. |
| restitution | Normal restitution coefficient. Default 0.3 keeps collisions plausibly inelastic for most FRC-style field interactions while still allowing visible bounce in high-speed impacts. |
| friction | Tangential friction coefficient. Default 0.6 gives balanced tangential damping (less endless sliding along walls, without overly abrupt sticking in grazing contacts). |
| user_id | Optional tag for custom behavior grouping. Default 0 means "unclassified"; assign other values when you need to identify this obstacle in custom behavior or telemetry code. |
Quaternion note: use Quaternion::fromEuler(roll, pitch, yaw) to rotate away from axis alignment.
◆ makeCylinder()
| FieldObstacle frcsim::FieldObstacle::makeCylinder |
( |
const Vector3 & | center_m, |
|
|
double | radius_m, |
|
|
double | half_height_m, |
|
|
const Quaternion & | orientation = Quaternion(), |
|
|
double | restitution = 0.3, |
|
|
double | friction = 0.6, |
|
|
int | user_id = 0 ) |
|
inlinestatic |
Creates an oriented cylinder obstacle aligned to local Z.
- Parameters
-
| center_m | Cylinder center in world coordinates. |
| radius_m | Cylinder radius. |
| half_height_m | Half of cylinder height along local Z. |
| orientation | Cylinder orientation quaternion. |
| restitution | Normal restitution coefficient. Default 0.3 for the same reason as other boundary factories: generally damped contacts that still show rebound at speed. |
| friction | Tangential friction coefficient. Default 0.6 to represent typical non-ice, non-rubberized field contact behavior. |
| user_id | Optional tag for custom behavior grouping. Default 0; set to a custom ID when this cylinder must be distinguished from other obstacles during contact handling. |
Example:
auto q = Quaternion::fromEuler(0.0, 0.0, 1.57079632679);
0.15, 0.6, q);
static FieldObstacle makeCylinder(const Vector3 ¢er_m, double radius_m, double half_height_m, const Quaternion &orientation=Quaternion(), double restitution=0.3, double friction=0.6, int user_id=0)
Creates an oriented cylinder obstacle aligned to local Z.
Definition obstacle.hpp:112
3D vector utility used throughout JSim physics.
Definition vector.hpp:22
◆ makePlane()
| FieldObstacle frcsim::FieldObstacle::makePlane |
( |
const Vector3 & | point_m, |
|
|
const Quaternion & | orientation, |
|
|
double | restitution = 0.3, |
|
|
double | friction = 0.6, |
|
|
int | user_id = 0 ) |
|
inlinestatic |
Creates an infinite plane obstacle.
- Parameters
-
| point_m | A point on the plane in world coordinates. |
| orientation | Plane orientation; local +Z is treated as outward normal. |
| restitution | Normal restitution coefficient. Default is 0.3, chosen as a conservative "not perfectly rigid" value for common field elements (wood, polycarbonate, carpet transitions). Lower values reduce bounce and help objects settle; higher values increase rebound speed and can make trajectories livelier but less damped. |
| friction | Tangential friction coefficient. Default is 0.6, which approximates moderate grip so glancing contacts lose tangential speed without unrealistically sticking. Lower values permit more sliding; higher values increase scrub/rolling slowdown. |
| user_id | Optional tag for custom behavior grouping. Default is 0 (no special grouping). Use non-zero IDs to classify boundaries for custom contact logic, filtering, analytics, or game-specific rules. |
◆ boundary
The documentation for this struct was generated from the following file: