tile2d
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
PhysicsTileProperties Class Reference

Contains the physical properties of a tile, such as elasticity. More...

#include <tileMap.hpp>

Public Member Functions

template<typename Integer >
Float getMomentOfInertia (const glm::vec< 2, Integer > &tileDimensions) const
 Returns the rotational inertia of this tile.
 
template<typename Integer >
Float getMass (const glm::vec< 2, Integer > &tileDimensions) const
 Returns the mass of this tile with using the area calculated from tileDimensions.
 

Public Attributes

Float density = 1.0f
 
uint8_t staticFriction = 255
 
uint8_t dynamicFriction = 255
 
uint8_t restitution = 0
 

Detailed Description

Contains the physical properties of a tile, such as elasticity.

Member Function Documentation

◆ getMass()

template<typename Integer >
Float PhysicsTileProperties::getMass ( const glm::vec< 2, Integer > & tileDimensions) const
inline

Returns the mass of this tile with using the area calculated from tileDimensions.

Parameters
tileDimensionsThe tileDimensions from which the area of this tile will be calculated

◆ getMomentOfInertia()

template<typename Integer >
Float PhysicsTileProperties::getMomentOfInertia ( const glm::vec< 2, Integer > & tileDimensions) const
inline

Returns the rotational inertia of this tile.

Parameters
tileDimensionsThe tileDimensions from which the area of this tile will be calculated

The documentation for this class was generated from the following file: