Optimizations and Physics Improvements

This commit is contained in:
Vulpovile
2022-10-05 20:35:59 -07:00
parent f587d1d6db
commit 530bcf2a74
3 changed files with 22 additions and 10 deletions

View File

@@ -49,12 +49,16 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;.\src\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
FloatingPointModel="0"
PrecompiledHeaderFile=".\Release/Blocks3D.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
@@ -82,6 +86,11 @@
ProgramDatabaseFile=".\Release/Blocks3D.pdb"
SubSystem="2"
StackReserveSize="16777216"
Driver="0"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="2"
LinkTimeCodeGeneration="1"
TargetMachine="1"
/>
<Tool

View File

@@ -342,6 +342,7 @@ void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
{
PartInstance * p = toDelete.back();
toDelete.pop_back();
if(g_dataModel->getSelectionService()->isSelected(p))
g_dataModel->getSelectionService()->removeSelected(p);
p->setParent(NULL);
delete p;
@@ -568,12 +569,12 @@ void Application::onGraphics(RenderDevice* rd) {
renderDevice->setShininess(70);
renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F));
//renderDevice->setShininess(70);
//renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F));
//float lightAmbient[] = { 0.5F, 0.6F, 0.9F, 1.0F };
//float lightDiffuse[] = { 0.6F, 0.4F, 0.9F, 1.0F };
//float lightSpecular[] = { 0.8F, 0.6F, 1.0F, 1.0F };
//float lightAmbient[] = { 0.5F, 0.5F, 0.5F, 1.0F };
//float lightDiffuse[] = { 0.6F, 0.6F, 0.6F, 1.0F };
//float lightSpecular[] = { 0.8F, 0.8F, 0.8F, 1.0F };
//glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, lightAmbient);
//glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, lightDiffuse);

View File

@@ -15,11 +15,11 @@ XplicitNgine::XplicitNgine()
physSpace = dHashSpaceCreate(0);
contactgroup = dJointGroupCreate(0);
dWorldSetGravity(physWorld, 0, -9.8, 0);
dWorldSetGravity(physWorld, 0, -9.8F, 0);
dWorldSetAutoDisableFlag(physWorld, 1);
dWorldSetAutoDisableLinearThreshold(physWorld, 0.05F);
dWorldSetAutoDisableAngularThreshold(physWorld, 0.05F);
dWorldSetAutoDisableSteps(physWorld, 400);
dWorldSetAutoDisableSteps(physWorld, 40);
this->name = "PhysicsService";
//dGeomID ground_geom = dCreatePlane(physSpace, 0, 1, 0, 0);
@@ -52,7 +52,7 @@ void collisionCallback(void *data, dGeomID o1, dGeomID o2)
// Define contact surface properties
contact[i].surface.bounce = 0.5; //Elasticity
contact[i].surface.mu = 0.3F; //Friction
contact[i].surface.mu = 0.4F; //Friction
contact[i].surface.slip1 = 0.0;
contact[i].surface.slip2 = 0.0;
contact[i].surface.soft_erp = 0.8F;
@@ -75,6 +75,8 @@ void XplicitNgine::deleteBody(PartInstance* partInstance)
if(partInstance->physBody != NULL)
{
dBodyEnable(partInstance->physBody);
if(partInstance->isAnchored())
dGeomSetBody(partInstance->physGeom[0], partInstance->physBody);
dGeomEnable(partInstance->physGeom[0]);
//createBody(partInstance);
//step(0.5F);