Initial JointsService and Snap implementation
This is incomplete and some issues need to be fixed
This commit is contained in:
29
src/source/DataModelV2/SnapInstance.cpp
Normal file
29
src/source/DataModelV2/SnapInstance.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "DataModelV2/SnapInstance.h"
|
||||
#include "XplicitNgine/XplicitNgine.h"
|
||||
#include "StringFunctions.h"
|
||||
#include "Globals.h"
|
||||
|
||||
SnapInstance::SnapInstance(PartInstance* Part1, PartInstance* Part2)
|
||||
{
|
||||
XplicitNgine* Phys = g_xplicitNgine;
|
||||
name = "Snap";
|
||||
className = "Snap";
|
||||
Joint1 = Part1;
|
||||
Joint2 = Part2;
|
||||
|
||||
if (Part1->physBody == NULL)
|
||||
Phys->createBody(Part1);
|
||||
|
||||
if (Part2->physBody == NULL)
|
||||
Phys->createBody(Part2);
|
||||
|
||||
Phys->createJoint(Part1, Part2);
|
||||
}
|
||||
|
||||
SnapInstance::~SnapInstance(void)
|
||||
{
|
||||
XplicitNgine* Phys = g_xplicitNgine;
|
||||
printf("SnapInstance destroyed...");
|
||||
Phys->destroyJoint(Joint1);
|
||||
Phys->destroyJoint(Joint2);
|
||||
}
|
||||
Reference in New Issue
Block a user