Crash fix + Added install.md
[+] Added install.md to help users install Volt. [#] Fixed a crash [#] Set m_bSimulating to true after m_ContactListener.PostSimulationFrame()
This commit is contained in:
parent
cc791dd311
commit
2ee44fc1fa
|
@ -0,0 +1,20 @@
|
|||
# Installing Volt
|
||||
|
||||
## 32bit Game
|
||||
|
||||
1. Download the latest [release](https://github.com/Joshua-Ashton/VPhysics-Jolt/releases)
|
||||
2. Copy the contents of the zip into the game's root directory and replace all files.
|
||||
|
||||
## 64bit Game
|
||||
|
||||
1. Download the latest [release](https://github.com/Joshua-Ashton/VPhysics-Jolt/releases)
|
||||
2. Copy all files located in the bin folder (from the ZIP) into the bin folder the game uses.
|
||||
NOTE: The path could be `bin/win64` or `bin/linux64`
|
||||
|
||||
## Gmod Dedicated Server
|
||||
|
||||
1. Download the latest [release](https://github.com/Joshua-Ashton/VPhysics-Jolt/releases)
|
||||
2. Copy all files located in the bin folder (from the ZIP) into the bin folder the game uses.
|
||||
NOTE: The path normal is `bin` could be `bin/win64` or `bin/linux64` if you use the `x86-64` Branch.
|
||||
3. Remove the `vphysics_srv.dll` and rename the `vphysics.dll` to `vphysics_srv.dll`.
|
||||
NOTE: on Linux it will be `vphysics_srv.so`
|
|
@ -765,12 +765,12 @@ void JoltPhysicsEnvironment::Simulate( float deltaTime )
|
|||
|
||||
HandleDebugDumpingEnvironment( VJOLT_RETURN_ADDRESS() );
|
||||
|
||||
m_bSimulating = true;
|
||||
|
||||
// Funnily enough, VPhysics calls this BEFORE
|
||||
// doing the simulation...
|
||||
m_ContactListener.PostSimulationFrame();
|
||||
|
||||
m_bSimulating = true;
|
||||
|
||||
// Run pre-simulation controllers
|
||||
for ( IJoltPhysicsController *pController : m_pPhysicsControllers )
|
||||
pController->OnPreSimulate( deltaTime );
|
||||
|
@ -818,8 +818,9 @@ void JoltPhysicsEnvironment::Simulate( float deltaTime )
|
|||
|
||||
// If the delete queue is disabled, we only added to it during the simulation
|
||||
// ie. callbacks etc. So flush that now.
|
||||
// RaphaelIT7: We need to delete all dead objects after simulating everything, or else Jolt freaks out for some reason.
|
||||
if ( !m_bEnableDeleteQueue )
|
||||
DeleteDeadObjects();
|
||||
DeleteDeadObjects(true);
|
||||
|
||||
#ifdef JPH_DEBUG_RENDERER
|
||||
JoltPhysicsDebugRenderer::GetInstance().RenderPhysicsSystem( m_PhysicsSystem );
|
||||
|
@ -1430,11 +1431,13 @@ void JoltPhysicsEnvironment::RemoveBodyAndDeleteObject( JoltPhysicsObject *pObje
|
|||
delete pObject;
|
||||
}
|
||||
|
||||
void JoltPhysicsEnvironment::DeleteDeadObjects()
|
||||
void JoltPhysicsEnvironment::DeleteDeadObjects( bool delBodies )
|
||||
{
|
||||
for ( JoltPhysicsObject *pObject : m_pDeadObjects )
|
||||
RemoveBodyAndDeleteObject( pObject );
|
||||
m_pDeadObjects.clear();
|
||||
if (delBodies) {
|
||||
for ( JoltPhysicsObject *pObject : m_pDeadObjects )
|
||||
RemoveBodyAndDeleteObject( pObject );
|
||||
m_pDeadObjects.clear();
|
||||
}
|
||||
|
||||
for ( JoltPhysicsConstraint *pConstraint : m_pDeadConstraints )
|
||||
delete pConstraint;
|
||||
|
|
|
@ -172,7 +172,7 @@ public:
|
|||
private:
|
||||
|
||||
void RemoveBodyAndDeleteObject( JoltPhysicsObject* pObject );
|
||||
void DeleteDeadObjects();
|
||||
void DeleteDeadObjects(bool delBodies = false);
|
||||
|
||||
template <typename T>
|
||||
void AddPhysicsSaveRestorePointer( uintp oldPtr, T* newPtr );
|
||||
|
|
Loading…
Reference in New Issue