Ajout de Jolt Physics + 1ere version des factory entitecomposants - camera, transform, rigidbody, collider, renderer
This commit is contained in:
32
lib/All/JoltPhysics/Samples/Tests/General/IslandTest.cpp
Normal file
32
lib/All/JoltPhysics/Samples/Tests/General/IslandTest.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
||||
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <TestFramework.h>
|
||||
|
||||
#include <Tests/General/IslandTest.h>
|
||||
#include <Jolt/Physics/Collision/Shape/BoxShape.h>
|
||||
#include <Jolt/Physics/Body/BodyCreationSettings.h>
|
||||
#include <Layers.h>
|
||||
|
||||
JPH_IMPLEMENT_RTTI_VIRTUAL(IslandTest)
|
||||
{
|
||||
JPH_ADD_BASE_CLASS(IslandTest, Test)
|
||||
}
|
||||
|
||||
void IslandTest::Initialize()
|
||||
{
|
||||
// Floor
|
||||
CreateFloor();
|
||||
|
||||
RefConst<Shape> box_shape = new BoxShape(Vec3(1.0f, 1.0f, 1.0f));
|
||||
|
||||
// Walls
|
||||
for (int i = 0; i < 10; ++i)
|
||||
for (int j = i / 2; j < 10 - (i + 1) / 2; ++j)
|
||||
for (int k = 0; k < 8; ++k)
|
||||
{
|
||||
RVec3 position(-10 + j * 2.0f + (i & 1? 1.0f : 0.0f), 1.0f + i * 2.0f, 8.0f * (k - 4));
|
||||
mBodyInterface->CreateAndAddBody(BodyCreationSettings(box_shape, position, Quat::sIdentity(), EMotionType::Dynamic, Layers::MOVING), EActivation::Activate);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user