Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
physics_math.h File Reference
#include <box2d/box2d.h>
#include <engine/physics/world/physics_world.h>
#include <engine/public/util/point.h>
#include <engine/public/util/vector3.h>
Include dependency graph for physics_math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PhysicsMath
 Namespace containing mathematical utility functions for physics calculations.
 

Functions

float PhysicsMath::to_meters (float pixels, float ratio) noexcept
 Convert pixels to meters using the specified ratio.
 
float PhysicsMath::to_pixels (float meters, float ratio) noexcept
 Convert meters to pixels using the specified ratio.
 
float PhysicsMath::to_radians (float degrees) noexcept
 Convert degrees to radians.
 
float PhysicsMath::to_degrees (float radians) noexcept
 Convert radians to degrees.
 
float PhysicsMath::convert_box2d_angle_to_radians (float sine, float cosine) noexcept
 Convert Box2D angle representation (sine, cosine) to radians.
 
float PhysicsMath::convert_radians_to_box2d_sine (float radians) noexcept
 Convert radians to Box2D sine value.
 
float PhysicsMath::convert_radians_to_box2d_cosine (float radians) noexcept
 Convert radians to Box2D cosine value.
 
float PhysicsMath::distance_between_points (const Point &a, const Point &b) noexcept
 Calculate the distance between two 2D points.
 
float PhysicsMath::dx_between_points (const Point &a, const Point &b) noexcept
 Calculate the difference in x-coordinates between two 2D points.
 
float PhysicsMath::dy_between_points (const Point &a, const Point &b) noexcept
 Calculate the difference in y-coordinates between two 2D points.
 
Vector3 PhysicsMath::box2d_vec_to_pixel_vec3 (const Vector3 &v, bool to_pixels=true)
 Convert a Vector3 to Box2D vector representation.
 
Vector3 PhysicsMath::vec3_to_box2d_vec3 (const Vector3 &v, bool from_pixels=true)
 Convert a Box2D vector representation to Vector3.
 
float PhysicsMath::box2d_to_pixels (float length) noexcept
 Convert length from Box2D units to pixels.
 
float PhysicsMath::pixels_to_box2d (float length) noexcept
 Convert length from pixels to Box2D units.
 
Vector3 PhysicsMath::physics_vec3_to_transform_pixel_vec3 (const Vector3 &v, float width, float height) noexcept
 Convert physics Vector3 to transform pixel Vector3.