Leviathan  0.8.0.0
Leviathan game engine
Leviathan::PhysMaterialDataPair Struct Reference

Defines properties between two materials. More...

#include <PhysicalMaterial.h>

Public Member Functions

DLLEXPORT PhysMaterialDataPair ()
 
DLLEXPORT PhysMaterialDataPair (PhysMaterialDataPair &&other)
 
DLLEXPORT PhysMaterialDataPairoperator= (PhysMaterialDataPair &&other)
 
DLLEXPORT PhysMaterialDataPairSetCollidable (bool collidable)
 Sets the material pair to collide or not with each other. More...
 
DLLEXPORT PhysMaterialDataPairSetCallbacks (const PhysicsMaterialAABBCallback aabb, const PhysicsMaterialContactCallback contact)
 Sets the callback functions that are called when the material interacts. More...
 

Public Attributes

bool Collidable
 
PhysicsMaterialAABBCallback AABBCallback
 
PhysicsMaterialContactCallback ContactCallback
 

Detailed Description

Defines properties between two materials.

Definition at line 35 of file PhysicalMaterial.h.

Constructor & Destructor Documentation

◆ PhysMaterialDataPair() [1/2]

DLLEXPORT Leviathan::PhysMaterialDataPair::PhysMaterialDataPair ( )
inline

Definition at line 36 of file PhysicalMaterial.h.

36  :
37  Collidable(true), AABBCallback(nullptr), ContactCallback(nullptr)
38  {}
PhysicsMaterialContactCallback ContactCallback
PhysicsMaterialAABBCallback AABBCallback

◆ PhysMaterialDataPair() [2/2]

DLLEXPORT Leviathan::PhysMaterialDataPair::PhysMaterialDataPair ( PhysMaterialDataPair &&  other)
inline

Definition at line 40 of file PhysicalMaterial.h.

40  :
41  Collidable(other.Collidable), AABBCallback(std::move(other.AABBCallback)),
42  ContactCallback(std::move(other.ContactCallback))
43  {}
PhysicsMaterialContactCallback ContactCallback
PhysicsMaterialAABBCallback AABBCallback

Member Function Documentation

◆ operator=()

DLLEXPORT PhysMaterialDataPair& Leviathan::PhysMaterialDataPair::operator= ( PhysMaterialDataPair &&  other)
inline

Definition at line 45 of file PhysicalMaterial.h.

46  {
47  Collidable = other.Collidable;
48  AABBCallback = std::move(other.AABBCallback);
49  ContactCallback = std::move(other.ContactCallback);
50  return *this;
51  }
PhysicsMaterialContactCallback ContactCallback
PhysicsMaterialAABBCallback AABBCallback

◆ SetCallbacks()

DLLEXPORT PhysMaterialDataPair& Leviathan::PhysMaterialDataPair::SetCallbacks ( const PhysicsMaterialAABBCallback  aabb,
const PhysicsMaterialContactCallback  contact 
)
inline

Sets the callback functions that are called when the material interacts.

Definition at line 94 of file PhysicalMaterial.h.

96  {
97  AABBCallback = aabb;
98  ContactCallback = contact;
99  return *this;
100  }
PhysicsMaterialContactCallback ContactCallback
PhysicsMaterialAABBCallback AABBCallback

◆ SetCollidable()

DLLEXPORT PhysMaterialDataPair& Leviathan::PhysMaterialDataPair::SetCollidable ( bool  collidable)
inline

Sets the material pair to collide or not with each other.

Warning
setting this to false prevents collision callbacks from being called
Note
Collision masks are more effective. This basically does collision rejecting automatically like PhysicsMaterialAABBCallback would
Todo:
Remove this

Definition at line 58 of file PhysicalMaterial.h.

59  {
60  Collidable = collidable;
61  return *this;
62  }

Member Data Documentation

◆ AABBCallback

PhysicsMaterialAABBCallback Leviathan::PhysMaterialDataPair::AABBCallback

Definition at line 110 of file PhysicalMaterial.h.

◆ Collidable

bool Leviathan::PhysMaterialDataPair::Collidable

Definition at line 103 of file PhysicalMaterial.h.

◆ ContactCallback

PhysicsMaterialContactCallback Leviathan::PhysMaterialDataPair::ContactCallback

Definition at line 111 of file PhysicalMaterial.h.


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