mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-08 13:14:33 +00:00
initial commit jolt
This commit is contained in:
parent
0c2aa5328c
commit
8acf7da95b
1086 changed files with 214612 additions and 4 deletions
31
Engine/lib/JoltPhysics/Samples/Tests/General/WallTest.cpp
Normal file
31
Engine/lib/JoltPhysics/Samples/Tests/General/WallTest.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
||||
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <TestFramework.h>
|
||||
|
||||
#include <Tests/General/WallTest.h>
|
||||
#include <Jolt/Physics/Collision/Shape/BoxShape.h>
|
||||
#include <Jolt/Physics/Body/BodyCreationSettings.h>
|
||||
#include <Layers.h>
|
||||
|
||||
JPH_IMPLEMENT_RTTI_VIRTUAL(WallTest)
|
||||
{
|
||||
JPH_ADD_BASE_CLASS(WallTest, Test)
|
||||
}
|
||||
|
||||
void WallTest::Initialize()
|
||||
{
|
||||
// Floor
|
||||
CreateFloor();
|
||||
|
||||
RefConst<Shape> box_shape = new BoxShape(Vec3(1.0f, 1.0f, 1.0f));
|
||||
|
||||
// Wall
|
||||
for (int i = 0; i < 10; ++i)
|
||||
for (int j = i / 2; j < 50 - (i + 1) / 2; ++j)
|
||||
{
|
||||
RVec3 position(-50 + j * 2.0f + (i & 1? 1.0f : 0.0f), 1.0f + i * 3.0f, 0);
|
||||
mBodyInterface->CreateAndAddBody(BodyCreationSettings(box_shape, position, Quat::sIdentity(), EMotionType::Dynamic, Layers::MOVING), EActivation::Activate);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue