Physixxxxx
This commit is contained in:
@@ -11,6 +11,7 @@ bool Globals::useMousePoint = false;
|
|||||||
|
|
||||||
const std::string Globals::PlaceholderName = "Dynamica";
|
const std::string Globals::PlaceholderName = "Dynamica";
|
||||||
std::vector<Instance*> g_selectedInstances = std::vector<Instance*>();
|
std::vector<Instance*> g_selectedInstances = std::vector<Instance*>();
|
||||||
|
bool running = false;
|
||||||
G3D::TextureRef Globals::surface;
|
G3D::TextureRef Globals::surface;
|
||||||
POINT Globals::mousepoint;
|
POINT Globals::mousepoint;
|
||||||
Globals::Globals(void){}
|
Globals::Globals(void){}
|
||||||
|
|||||||
@@ -21,3 +21,4 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern std::vector<Instance*> g_selectedInstances;
|
extern std::vector<Instance*> g_selectedInstances;
|
||||||
|
extern bool running;
|
||||||
20
main.cpp
20
main.cpp
@@ -72,7 +72,6 @@ static int cursorOvrid = 0;
|
|||||||
static int currentcursorid = 0;
|
static int currentcursorid = 0;
|
||||||
static G3D::TextureRef cursor = NULL;
|
static G3D::TextureRef cursor = NULL;
|
||||||
static G3D::TextureRef cursorOvr = NULL;
|
static G3D::TextureRef cursorOvr = NULL;
|
||||||
static bool running = true;
|
|
||||||
static bool mouseMovedBeginMotion = false;
|
static bool mouseMovedBeginMotion = false;
|
||||||
static const int CURSOR = 0;
|
static const int CURSOR = 0;
|
||||||
static const int ARROWS = 1;
|
static const int ARROWS = 1;
|
||||||
@@ -852,8 +851,23 @@ std::vector<Instance*> Demo::getSelection()
|
|||||||
return g_selectedInstances;
|
return g_selectedInstances;
|
||||||
}
|
}
|
||||||
void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
|
void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
|
||||||
|
if(!running)
|
||||||
|
{
|
||||||
|
std::vector <Instance* > objects = dataModel->getWorkspace()->getAllChildren();
|
||||||
|
for(size_t i = 0; i < objects.size(); i++)
|
||||||
|
{
|
||||||
|
if(PartInstance* moveTo = dynamic_cast<PartInstance*>(objects.at(i)))
|
||||||
|
{
|
||||||
|
moveTo->velocity.y -= (196.2F/30);
|
||||||
|
moveTo->setPosition(Vector3(moveTo->getPosition().x, moveTo->getPosition().y+(moveTo->velocity.y)/30, moveTo->getPosition().z));
|
||||||
|
if(moveTo->getPosition().y < -128)
|
||||||
|
{
|
||||||
|
moveTo->setParent(NULL);
|
||||||
|
delete moveTo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Instance * obj6 = dataModel->getGuiRoot()->findFirstChild("Delete");
|
Instance * obj6 = dataModel->getGuiRoot()->findFirstChild("Delete");
|
||||||
Instance * obj = dataModel->getGuiRoot()->findFirstChild("Duplicate");
|
Instance * obj = dataModel->getGuiRoot()->findFirstChild("Duplicate");
|
||||||
|
|||||||
Reference in New Issue
Block a user