c_api_physics_world.h - Engine C API Reference

c_api_physics_world.h
  1. #pragma once
  2. #include "c_api_types.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. struct PhysicsWorldCApi
  7. {
  8. /*
  9. The raycast, sweep and overlap function calls will return the total number of hits made as an unsigned.
  10. Up to num_elements results will be stored in the pre-allocated out_buffer you provide.
  11. */
  12. unsigned (*raycast) (struct CollisionHit* out_buffer, unsigned num_elements, PhysicsWorldPtr, ConstVector3Ptr from, ConstVector3Ptr direction,
  13. enum RaycastType, enum ActorTemplate, unsigned collision_filter_id32, float length);
  14. unsigned (*cast) (RaycastId, struct CollisionHit* out_buffer, unsigned num_elements, ConstVector3Ptr from, ConstVector3Ptr direction, float length);
  15. /* Returns a unique id that can be used with the cast() function as many times as needed.
  16. The caller is responsible for deallocating this by calling destroy_raycast(). */
  17. RaycastId (*make_raycast) (PhysicsWorldPtr, enum RaycastType, enum ActorTemplate, unsigned collision_filter_id32);
  18. void (*destroy_raycast) (RaycastId);
  19. unsigned (*overlap) (ActorPtr* out_buffer, unsigned num_elements, PhysicsWorldPtr, enum OverlapShape, ConstVector3Ptr optional_position, ConstQuaternionPtr optional_rotation,
  20. ConstMatrix4x4Ptr optional_pose, ConstVector3Ptr optional_size, enum ActorTemplate, unsigned collision_filter_id32);
  21. unsigned (*linear_sphere_sweep) (struct CollisionHit* out_buffer, unsigned num_elements, PhysicsWorldPtr, ConstVector3Ptr from, ConstVector3Ptr to,
  22. float radius, enum ActorTemplate, unsigned collision_filter_id32, int report_initial_overlap);
  23. unsigned (*linear_capsule_sweep) (struct CollisionHit* out_buffer, unsigned num_elements, PhysicsWorldPtr, ConstVector3Ptr from, ConstVector3Ptr to, ConstQuaternionPtr rotation,
  24. float radius, float half_height, enum ActorTemplate, unsigned collision_filter_id32, int report_initial_overlap);
  25. unsigned (*linear_obb_sweep) (struct CollisionHit* out_buffer, unsigned num_elements, PhysicsWorldPtr, ConstVector3Ptr from, ConstVector3Ptr to, ConstVector3Ptr extents,
  26. ConstQuaternionPtr rotation, enum ActorTemplate, unsigned collision_filter_id32, int report_initial_overlap);
  27. };
  28. #ifdef __cplusplus
  29. }
  30. #endif