Files
Blocks3D/src/source/DataModelV2/SnapInstance.cpp
NT_x86 9cee74baf4 Initial JointsService and Snap implementation
This is incomplete and some issues need to be fixed
2023-03-26 18:51:11 +03:00

30 lines
635 B
C++

#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);
}