Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
Public Member Functions | Public Attributes

PhysicObject Class Reference

A base class containing common functions to all physic objects. More...

#include <header.hpp>

Inheritance diagram for PhysicObject:
Object PhCircle PhLine PhRect PhShape PhTriangle

List of all members.

Public Member Functions

bool IsPointInside (Vector2D ponumber)
 Return true if the point is inside the object, false otherwise.
nil SetEventFunction (luaObject luaFunction)
 Set the event function name (fnName should be the name of an existing lua function).
luaObject GetEventFunction ()
 Get the event function name.
number GetPhysicGroup ()
 Get the physic group associated to the object.
bool IsIntersect (PhysicObject obj)
 Return true if the object collide the given object.
luaObject IsIntersectWithGroup (number phGroup)
 Return the list of objects that collide the given physic group.

Public Attributes

std::string eventFunction
 Acces the event function name (fnName should be the name of an existing lua function).

Detailed Description

A base class containing common functions to all physic objects.


Member Function Documentation

luaObject PhysicObject::GetEventFunction ( )

Get the event function name.

number PhysicObject::GetPhysicGroup ( )

Get the physic group associated to the object.

bool PhysicObject::IsIntersect ( PhysicObject  obj)

Return true if the object collide the given object.

luaObject PhysicObject::IsIntersectWithGroup ( number  phGroup)

Return the list of objects that collide the given physic group.

bool PhysicObject::IsPointInside ( Vector2D  ponumber)

Return true if the point is inside the object, false otherwise.

nil PhysicObject::SetEventFunction ( luaObject  luaFunction)

Set the event function name (fnName should be the name of an existing lua function).


Function prototype should be : function fnName(thisObject : PhysicObject, theOtherObject : PhysicObject, intersectionPosition : Vector2D, penetrationVector : Vector2D)
Where :

  • thisObject is this physic object
  • theOtherObject is physic object which intersect this one
  • intersectionPosition the global position of the intersection
  • penetrationVector how much you need to move thisObject to remove it from theOtherObject

Member Data Documentation

Acces the event function name (fnName should be the name of an existing lua function).


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables