Compare commits
10 commits
f16f3a8b79
...
78d2466efd
Author | SHA1 | Date | |
---|---|---|---|
78d2466efd | |||
3a6fb2ada2 | |||
219ca94ded | |||
bea19b21d7 | |||
3dfc3abaf8 | |||
2f0f507051 | |||
7f36a84938 | |||
ded96d4e1f | |||
0bd6acb7fa | |||
cbeaa4d2bb |
19 changed files with 598 additions and 158 deletions
|
@ -7,6 +7,7 @@
|
|||
enum class DEF_ENUM PartType {
|
||||
Ball = 0,
|
||||
Block = 1,
|
||||
Cylinder = 2,
|
||||
};
|
||||
|
||||
namespace EnumType {
|
||||
|
|
|
@ -17,6 +17,9 @@ void JointInstance::OnAncestryChanged(nullable std::shared_ptr<Instance>, nullab
|
|||
Update();
|
||||
}
|
||||
|
||||
void JointInstance::OnPartParamsUpdated() {
|
||||
}
|
||||
|
||||
void JointInstance::Update() {
|
||||
// To keep it simple compared to our previous algorithm, this one is pretty barebones:
|
||||
// 1. Every time we update, (whether our parent changed, or a property), destroy the current joints
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "objects/base/instance.h"
|
||||
#include "../annotation.h"
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include "datatypes/cframe.h"
|
||||
#include "physics/world.h"
|
||||
|
||||
|
@ -12,6 +11,8 @@
|
|||
#include "objects/part/part.h"
|
||||
#endif
|
||||
|
||||
#define DEF_PROP_PHYS DEF_PROP_(on_update=onUpdated)
|
||||
|
||||
class BasePart;
|
||||
class Workspace;
|
||||
|
||||
|
@ -33,12 +34,15 @@ protected:
|
|||
virtual void buildJoint() = 0;
|
||||
public:
|
||||
void Update();
|
||||
virtual void OnPartParamsUpdated();
|
||||
|
||||
DEF_PROP_(on_update=onUpdated) std::weak_ptr<BasePart> part0;
|
||||
DEF_PROP_(on_update=onUpdated) std::weak_ptr<BasePart> part1;
|
||||
DEF_PROP_(on_update=onUpdated) CFrame c0;
|
||||
DEF_PROP_(on_update=onUpdated) CFrame c1;
|
||||
DEF_PROP_PHYS std::weak_ptr<BasePart> part0;
|
||||
DEF_PROP_PHYS std::weak_ptr<BasePart> part1;
|
||||
DEF_PROP_PHYS CFrame c0;
|
||||
DEF_PROP_PHYS CFrame c1;
|
||||
|
||||
JointInstance(const InstanceType*);
|
||||
~JointInstance();
|
||||
};
|
||||
};
|
||||
|
||||
#undef DEF_PROP_PHYS
|
|
@ -20,7 +20,7 @@ void Rotate::buildJoint() {
|
|||
part1.lock()->cframe = newFrame;
|
||||
|
||||
// Do NOT use Abs() in this scenario. For some reason that breaks it
|
||||
PhysJointHingeInfo jointInfo((part0.lock()->cframe * c0).Position(), -(part0.lock()->cframe * c0).LookVector().Unit());
|
||||
PhysRotatingJointInfo jointInfo(c0, c1);
|
||||
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());
|
||||
jointWorkspace = workspace;
|
||||
}
|
|
@ -21,8 +21,14 @@ void RotateV::buildJoint() {
|
|||
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
|
||||
part1.lock()->cframe = newFrame;
|
||||
// Do NOT use Abs() in this scenario. For some reason that breaks it
|
||||
PhysJointMotorInfo jointInfo((part0.lock()->cframe * c0).Position(), -(part0.lock()->cframe * c0).LookVector().Unit());
|
||||
float vel = part0.lock()->GetSurfaceParamB(-c0.LookVector().Unit()) * 6.28;
|
||||
PhysRotatingJointInfo jointInfo(c0, c1, vel);
|
||||
|
||||
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());
|
||||
jointWorkspace = workspace;
|
||||
}
|
||||
|
||||
void RotateV::OnPartParamsUpdated() {
|
||||
float vel = part0.lock()->GetSurfaceParamB(-c0.LookVector().Unit()) * 6.28;
|
||||
this->joint.setAngularVelocity(vel);
|
||||
}
|
|
@ -13,6 +13,8 @@ public:
|
|||
RotateV();
|
||||
~RotateV();
|
||||
|
||||
void OnPartParamsUpdated() override;
|
||||
|
||||
static inline std::shared_ptr<RotateV> New() { return std::make_shared<RotateV>(); };
|
||||
static inline std::shared_ptr<Instance> Create() { return std::make_shared<RotateV>(); };
|
||||
};
|
|
@ -23,7 +23,7 @@ void Snap::buildJoint() {
|
|||
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
|
||||
part1.lock()->cframe = newFrame;
|
||||
|
||||
PhysJointSnapInfo jointInfo((c0.Inverse() * c1).Position());
|
||||
PhysFixedJointInfo jointInfo(c0, c1);
|
||||
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());
|
||||
jointWorkspace = workspace;
|
||||
}
|
|
@ -23,7 +23,7 @@ void Weld::buildJoint() {
|
|||
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
|
||||
part1.lock()->cframe = newFrame;
|
||||
|
||||
PhysJointWeldInfo jointInfo((c0.Inverse() * c1).Position());
|
||||
PhysFixedJointInfo jointInfo(c0, c1);
|
||||
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());
|
||||
jointWorkspace = workspace;
|
||||
}
|
|
@ -26,7 +26,6 @@ BasePart::BasePart(const InstanceType* type, PartConstructParams params): PVInst
|
|||
}
|
||||
|
||||
BasePart::~BasePart() {
|
||||
// This relies on physicsCommon still existing. Be very careful.
|
||||
if (workspace() != nullptr) {
|
||||
workspace()->RemoveBody(shared<BasePart>());
|
||||
}
|
||||
|
@ -71,6 +70,15 @@ void BasePart::onUpdated(std::string property) {
|
|||
BreakJoints();
|
||||
}
|
||||
|
||||
void BasePart::onParamUpdated(std::string property) {
|
||||
// Send signal to joints to update themselves
|
||||
for (std::weak_ptr<JointInstance> joint : primaryJoints) {
|
||||
if (joint.expired()) continue;
|
||||
|
||||
joint.lock()->OnPartParamsUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
// Expands provided extents to fit point
|
||||
static void expandMaxExtents(Vector3* min, Vector3* max, Vector3 point) {
|
||||
*min = Vector3(glm::min(min->X(), point.X()), glm::min(min->Y(), point.Y()), glm::min(min->Z(), point.Z()));
|
||||
|
@ -286,6 +294,10 @@ void BasePart::MakeJoints() {
|
|||
joint->part1 = otherPart->shared<BasePart>();
|
||||
joint->c0 = contact0;
|
||||
joint->c1 = contact1;
|
||||
// // If both parts touch directly, this can cause friction in Rotate and RotateV joints, so we leave a little extra space
|
||||
// if (joint->IsA("Rotate") || joint->IsA("RotateV"))
|
||||
// joint->c1 = joint->c1 + joint->c1.LookVector() * 0.02f,
|
||||
// joint->c0 = joint->c0 - joint->c0.LookVector() * 0.02f;
|
||||
dataModel()->GetService<JointsService>()->AddChild(joint);
|
||||
joint->UpdateProperty("Part0");
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
#include "objects/pvinstance.h"
|
||||
#include "physics/world.h"
|
||||
|
||||
// Common macro for part properties
|
||||
#define DEF_PROP_PHYS DEF_PROP_(on_update=onUpdated)
|
||||
#define DEF_PROP_PHYSPARAM DEF_PROP_(on_update=onParamUpdated)
|
||||
|
||||
// For easy construction from C++. Maybe should be removed?
|
||||
struct PartConstructParams {
|
||||
Vector3 position;
|
||||
|
@ -51,19 +55,20 @@ protected:
|
|||
virtual void OnWorkspaceRemoved(std::shared_ptr<Workspace> oldWorkspace) override;
|
||||
void OnAncestryChanged(nullable std::shared_ptr<Instance> child, nullable std::shared_ptr<Instance> newParent) override;
|
||||
void onUpdated(std::string);
|
||||
void onParamUpdated(std::string);
|
||||
|
||||
BasePart(const InstanceType*);
|
||||
BasePart(const InstanceType*, PartConstructParams params);
|
||||
public:
|
||||
DEF_PROP_CATEGORY(DATA)
|
||||
DEF_PROP_(on_update=onUpdated) Vector3 velocity;
|
||||
DEF_PROP_PHYS Vector3 velocity;
|
||||
[[ def_prop(name="CFrame", on_update=onUpdated), cframe_position_prop(name="Position"), cframe_rotation_prop(name="Rotation") ]]
|
||||
CFrame cframe;
|
||||
|
||||
DEF_PROP_CATEGORY(PART)
|
||||
// Special compatibility changes for this property were made in
|
||||
// Instance::Serialize
|
||||
DEF_PROP_(on_update=onUpdated) Vector3 size;
|
||||
DEF_PROP_PHYS Vector3 size;
|
||||
|
||||
DEF_PROP_CATEGORY(APPEARANCE)
|
||||
DEF_PROP Color3 color;
|
||||
|
@ -71,8 +76,8 @@ public:
|
|||
DEF_PROP float reflectance = 0.f;
|
||||
|
||||
DEF_PROP_CATEGORY(BEHAVIOR)
|
||||
DEF_PROP_(on_update=onUpdated) bool anchored = false;
|
||||
DEF_PROP_(on_update=onUpdated) bool canCollide = true;
|
||||
DEF_PROP_PHYS bool anchored = false;
|
||||
DEF_PROP_PHYS bool canCollide = true;
|
||||
DEF_PROP bool locked = false;
|
||||
|
||||
DEF_PROP_CATEGORY(SURFACE)
|
||||
|
@ -84,19 +89,19 @@ public:
|
|||
DEF_PROP SurfaceType backSurface = SurfaceType::Smooth;
|
||||
|
||||
DEF_PROP_CATEGORY(SURFACE_INPUT)
|
||||
DEF_PROP float topParamA = -0.5;
|
||||
DEF_PROP float bottomParamA = -0.5;
|
||||
DEF_PROP float leftParamA = -0.5;
|
||||
DEF_PROP float rightParamA = -0.5;
|
||||
DEF_PROP float frontParamA = -0.5;
|
||||
DEF_PROP float backParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float topParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float bottomParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float leftParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float rightParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float frontParamA = -0.5;
|
||||
DEF_PROP_PHYSPARAM float backParamA = -0.5;
|
||||
|
||||
DEF_PROP float topParamB = 0.5;
|
||||
DEF_PROP float bottomParamB = 0.5;
|
||||
DEF_PROP float leftParamB = 0.5;
|
||||
DEF_PROP float rightParamB = 0.5;
|
||||
DEF_PROP float frontParamB = 0.5;
|
||||
DEF_PROP float backParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float topParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float bottomParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float leftParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float rightParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float frontParamB = 0.5;
|
||||
DEF_PROP_PHYSPARAM float backParamB = 0.5;
|
||||
|
||||
DEF_SIGNAL SignalSource Touched;
|
||||
DEF_SIGNAL SignalSource TouchEnded;
|
||||
|
@ -117,4 +122,7 @@ public:
|
|||
|
||||
// Calculate size of axis-aligned bounding box
|
||||
Vector3 GetAABB();
|
||||
};
|
||||
};
|
||||
|
||||
#undef DEF_PROP_PHYS
|
||||
#undef DEF_PROP_PHYSPARAM
|
|
@ -9,5 +9,14 @@ Part::Part(PartConstructParams params): BasePart(&TYPE, params) {
|
|||
}
|
||||
|
||||
Vector3 Part::GetEffectiveSize() {
|
||||
return shape == PartType::Ball ? (Vector3)glm::vec3(glm::min(size.X(), size.Y(), size.Z())) : size;
|
||||
float diameter;
|
||||
switch (shape) {
|
||||
case PartType::Ball:
|
||||
return (Vector3)glm::vec3(glm::min(size.X(), size.Y(), size.Z()));
|
||||
case PartType::Cylinder:
|
||||
diameter = glm::min(size.Y(), size.Z());
|
||||
return Vector3(size.X(), diameter, diameter);
|
||||
default:
|
||||
return size;
|
||||
}
|
||||
}
|
|
@ -1,91 +1,6 @@
|
|||
#include "wedgepart.h"
|
||||
// #include <reactphysics3d/collision/ConvexMesh.h>
|
||||
// #include <reactphysics3d/collision/shapes/ConvexMeshShape.h>
|
||||
|
||||
// rp::ConvexMesh* wedgePhysMesh;
|
||||
|
||||
WedgePart::WedgePart(): BasePart(&TYPE) {
|
||||
}
|
||||
|
||||
WedgePart::WedgePart(PartConstructParams params): BasePart(&TYPE, params) {
|
||||
|
||||
}
|
||||
|
||||
// void WedgePart::updateCollider(rp::PhysicsCommon* common) {
|
||||
// Logger::fatalError("Wedges are currently disabled! Please do not use them or your editor may crash\n");
|
||||
// rp::ConvexMeshShape* shape = common->createConvexMeshShape(wedgePhysMesh, glmToRp(size * glm::vec3(0.5f)));
|
||||
|
||||
// // Recreate the rigidbody if the shape changes
|
||||
// if (rigidBody->getNbColliders() > 0
|
||||
// && dynamic_cast<rp::ConvexMeshShape*>(rigidBody->getCollider(0)->getCollisionShape())->getScale() != shape->getScale()) {
|
||||
// // TODO: This causes Touched to get called twice. Fix this.
|
||||
// rigidBody->removeCollider(rigidBody->getCollider(0));
|
||||
// rigidBody->addCollider(shape, rp::Transform());
|
||||
// }
|
||||
|
||||
// if (rigidBody->getNbColliders() == 0)
|
||||
// rigidBody->addCollider(shape, rp::Transform());
|
||||
// }
|
||||
|
||||
// void WedgePart::createWedgeShape(rp::PhysicsCommon* common) {
|
||||
// // https://www.reactphysics3d.com/documentation/index.html#creatingbody
|
||||
// float vertices[] = {
|
||||
// // X Y Z
|
||||
// /*0*/ -1, 1, 1, // 0
|
||||
// /*1*/ -1, -1, 1, // |
|
||||
// /*2*/ -1, -1, -1, // 1---2
|
||||
|
||||
// /*3*/ 1, 1, 1,
|
||||
// /*4*/ 1, -1, 1,
|
||||
// /*5*/ 1, -1, -1,
|
||||
// };
|
||||
|
||||
// // -x +x
|
||||
// // +z 1----------4
|
||||
// // | bottom |
|
||||
// // -z 2----------5
|
||||
|
||||
// // -x +x
|
||||
// // +y 0----------3
|
||||
// // | front |
|
||||
// // -y 1----------4
|
||||
|
||||
// // -x +x
|
||||
// // +yz 0----------3
|
||||
// // | slope |
|
||||
// // -yz 2----------5
|
||||
|
||||
// int indices[] = {
|
||||
// // Base
|
||||
// 1, 2, 5, 4,
|
||||
|
||||
// // Back-face
|
||||
// 0, 1, 4, 3,
|
||||
// // 4, 1, 0, 3,
|
||||
|
||||
// // Slope
|
||||
// 0, 2, 5, 3,
|
||||
// // 3, 5, 2, 0,
|
||||
|
||||
// // Sides
|
||||
// 0, 1, 2,
|
||||
// 3, 4, 5,
|
||||
// };
|
||||
|
||||
// // Description of the six faces of the convex mesh
|
||||
// rp::PolygonVertexArray::PolygonFace* polygonFaces = new rp::PolygonVertexArray::PolygonFace[5];
|
||||
// polygonFaces[0] = { 4, 0 }; // Bottom
|
||||
// polygonFaces[1] = { 4, 4 }; // Front
|
||||
// polygonFaces[2] = { 4, 8 }; // Slope
|
||||
// polygonFaces[3] = { 3, 12 }; // Side
|
||||
// polygonFaces[4] = { 3, 15 }; // Side
|
||||
|
||||
// // Create the polygon vertex array
|
||||
// rp::PolygonVertexArray polygonVertexArray(6, vertices, 3 * sizeof(float), indices, sizeof(int), 5, polygonFaces,
|
||||
// rp::PolygonVertexArray::VertexDataType::VERTEX_FLOAT_TYPE,
|
||||
// rp::PolygonVertexArray::IndexDataType::INDEX_INTEGER_TYPE);
|
||||
|
||||
// // Create the convex mesh
|
||||
// std::vector<rp::Message> messages;
|
||||
// // wedgePhysMesh = common->createConvexMesh(polygonVertexArray, messages);
|
||||
// }
|
||||
WedgePart::WedgePart(PartConstructParams params): BasePart(&TYPE, params) {}
|
|
@ -3,13 +3,9 @@
|
|||
#include "basepart.h"
|
||||
#include "objects/annotation.h"
|
||||
|
||||
class DEF_INST_(hidden) WedgePart : public BasePart {
|
||||
class DEF_INST WedgePart : public BasePart {
|
||||
AUTOGEN_PREAMBLE
|
||||
|
||||
protected:
|
||||
// static void createWedgeShape(rp::PhysicsCommon* common);
|
||||
|
||||
friend Workspace;
|
||||
public:
|
||||
WedgePart();
|
||||
WedgePart(PartConstructParams params);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "logger.h"
|
||||
#include "objects/part/basepart.h"
|
||||
#include "objects/part/part.h"
|
||||
#include "objects/part/wedgepart.h"
|
||||
#include "objects/service/workspace.h"
|
||||
#include "physics/convert.h"
|
||||
#include "timeutil.h"
|
||||
|
@ -21,6 +22,10 @@
|
|||
#include <Jolt/Physics/Collision/RayCast.h>
|
||||
#include <Jolt/Physics/Collision/Shape/BoxShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/SphereShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/CylinderShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/ScaledShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/ConvexHullShape.h>
|
||||
#include <Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h>
|
||||
#include <Jolt/Physics/EActivation.h>
|
||||
#include <Jolt/Physics/PhysicsSettings.h>
|
||||
#include <Jolt/RegisterTypes.h>
|
||||
|
@ -31,26 +36,59 @@
|
|||
#include <Jolt/Physics/Body/BodyLockInterface.h>
|
||||
#include <Jolt/Physics/Collision/NarrowPhaseQuery.h>
|
||||
#include <Jolt/Physics/Constraints/FixedConstraint.h>
|
||||
#include <Jolt/Physics/Constraints/HingeConstraint.h>
|
||||
#include <memory>
|
||||
|
||||
static JPH::TempAllocator* allocator;
|
||||
static JPH::JobSystem* jobSystem;
|
||||
|
||||
|
||||
namespace Layers
|
||||
{
|
||||
static constexpr JPH::ObjectLayer DYNAMIC = 0;
|
||||
static constexpr JPH::ObjectLayer ANCHORED = 1;
|
||||
static constexpr JPH::ObjectLayer NUM_LAYERS = 2;
|
||||
static constexpr JPH::ObjectLayer NOCOLLIDE = 2;
|
||||
// static constexpr JPH::ObjectLayer NUM_LAYERS = 3;
|
||||
};
|
||||
|
||||
namespace BPLayers
|
||||
{
|
||||
static constexpr JPH::BroadPhaseLayer ANCHORED(0);
|
||||
static constexpr JPH::BroadPhaseLayer DYNAMIC(1);
|
||||
static constexpr uint NUM_LAYERS(2);
|
||||
static constexpr JPH::BroadPhaseLayer NOCOLLIDE(2);
|
||||
static constexpr uint NUM_LAYERS(3);
|
||||
};
|
||||
|
||||
static JPH::Ref<JPH::Shape> wedgeShape;
|
||||
|
||||
void physicsInit() {
|
||||
JPH::RegisterDefaultAllocator();
|
||||
JPH::Factory::sInstance = new JPH::Factory();
|
||||
JPH::RegisterTypes();
|
||||
|
||||
allocator = new JPH::TempAllocatorImpl(10 * 1024 * 1024);
|
||||
jobSystem = new JPH::JobSystemThreadPool(JPH::cMaxPhysicsJobs, JPH::cMaxPhysicsBarriers, std::thread::hardware_concurrency() - 1);
|
||||
|
||||
// Create special shapes
|
||||
JPH::Array<JPH::Vec3> wedgeVerts;
|
||||
wedgeVerts.push_back({-1, -1, -1});
|
||||
wedgeVerts.push_back({ 1, -1, -1});
|
||||
wedgeVerts.push_back({-1, -1, 1});
|
||||
wedgeVerts.push_back({ 1, -1, 1});
|
||||
wedgeVerts.push_back({ 1, 1, 1});
|
||||
wedgeVerts.push_back({-1, 1, 1});
|
||||
// // Invisible bevel to avoid phasing
|
||||
// wedgeVerts.push_back({1, 1, 0.9});
|
||||
// wedgeVerts.push_back({0, 1, 0.9});
|
||||
|
||||
wedgeShape = JPH::ConvexHullShapeSettings(wedgeVerts).Create().Get();
|
||||
}
|
||||
|
||||
void physicsDeinit() {
|
||||
JPH::UnregisterTypes();
|
||||
delete JPH::Factory::sInstance;
|
||||
JPH::Factory::sInstance = nullptr;
|
||||
}
|
||||
|
||||
PhysWorld::PhysWorld() {
|
||||
worldImpl.Init(4096, 0, 4096, 4096, broadPhaseLayerInterface, objectBroadPhasefilter, objectLayerPairFilter);
|
||||
worldImpl.SetGravity(JPH::Vec3(0, -196, 0));
|
||||
|
@ -69,7 +107,16 @@ void PhysWorld::addBody(std::shared_ptr<BasePart> part) {
|
|||
}
|
||||
|
||||
void PhysWorld::removeBody(std::shared_ptr<BasePart> part) {
|
||||
// TODO:
|
||||
JPH::BodyInterface& interface = worldImpl.GetBodyInterface();
|
||||
|
||||
// https://jrouwe.github.io/JoltPhysics/index.html#sleeping-bodies
|
||||
// Wake sleeping bodies in its area before removing it
|
||||
Vector3 aabbSize = part->GetAABB();
|
||||
interface.ActivateBodiesInAABox(JPH::AABox(convert<JPH::Vec3>(part->position() - aabbSize), convert<JPH::Vec3>(part->position() + aabbSize)), {}, {});
|
||||
|
||||
interface.RemoveBody(part->rigidBody.bodyImpl->GetID());
|
||||
interface.DestroyBody(part->rigidBody.bodyImpl->GetID());
|
||||
part->rigidBody.bodyImpl = nullptr;
|
||||
}
|
||||
|
||||
JPH::Shape* makeShape(std::shared_ptr<BasePart> basePart) {
|
||||
|
@ -79,8 +126,11 @@ JPH::Shape* makeShape(std::shared_ptr<BasePart> basePart) {
|
|||
return new JPH::BoxShape(convert<JPH::Vec3>(part->size / 2.f), JPH::cDefaultConvexRadius);
|
||||
case PartType::Ball:
|
||||
return new JPH::SphereShape(glm::min(part->size.X(), part->size.Y(), part->size.Z()) / 2.f);
|
||||
break;
|
||||
case PartType::Cylinder:
|
||||
return new JPH::RotatedTranslatedShape(JPH::Vec3(), JPH::Quat::sEulerAngles(JPH::Vec3(0, 0, JPH::JPH_PI * 0.5)), new JPH::CylinderShape(part->size.X() / 2.f, glm::min(part->size.Z(), part->size.Y()) / 2.f));
|
||||
}
|
||||
} else if (std::shared_ptr<WedgePart> part = std::dynamic_pointer_cast<WedgePart>(basePart)) {
|
||||
return new JPH::ScaledShape(wedgeShape, convert<JPH::Vec3>(part->size / 2.f));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -90,7 +140,7 @@ void PhysWorld::syncBodyProperties(std::shared_ptr<BasePart> part) {
|
|||
|
||||
JPH::EMotionType motionType = part->anchored ? JPH::EMotionType::Static : JPH::EMotionType::Dynamic;
|
||||
JPH::EActivation activationMode = part->anchored ? JPH::EActivation::DontActivate : JPH::EActivation::Activate;
|
||||
JPH::ObjectLayer objectLayer = part->anchored ? Layers::ANCHORED : Layers::DYNAMIC;
|
||||
JPH::ObjectLayer objectLayer = !part->canCollide ? Layers::NOCOLLIDE : (part->anchored ? Layers::ANCHORED : Layers::DYNAMIC);
|
||||
|
||||
JPH::Body* body = part->rigidBody.bodyImpl;
|
||||
|
||||
|
@ -98,6 +148,7 @@ void PhysWorld::syncBodyProperties(std::shared_ptr<BasePart> part) {
|
|||
if (body == nullptr) {
|
||||
JPH::Shape* shape = makeShape(part);
|
||||
JPH::BodyCreationSettings settings(shape, convert<JPH::Vec3>(part->position()), convert<JPH::Quat>((glm::quat)part->cframe.RotMatrix()), motionType, objectLayer);
|
||||
settings.mAllowDynamicOrKinematic = true;
|
||||
settings.mRestitution = 0.5;
|
||||
|
||||
body = interface.CreateBody(settings);
|
||||
|
@ -123,21 +174,9 @@ void PhysWorld::syncBodyProperties(std::shared_ptr<BasePart> part) {
|
|||
interface.SetMotionType(body->GetID(), motionType, activationMode);
|
||||
interface.SetPositionRotationAndVelocity(body->GetID(), convert<JPH::Vec3>(part->position()), convert<JPH::Quat>((glm::quat)part->cframe.RotMatrix()), convert<JPH::Vec3>(part->velocity), /* Angular velocity is NYI: */ body->GetAngularVelocity());
|
||||
}
|
||||
}
|
||||
|
||||
void physicsInit() {
|
||||
JPH::RegisterDefaultAllocator();
|
||||
JPH::Factory::sInstance = new JPH::Factory();
|
||||
JPH::RegisterTypes();
|
||||
|
||||
allocator = new JPH::TempAllocatorImpl(10 * 1024 * 1024);
|
||||
jobSystem = new JPH::JobSystemThreadPool(JPH::cMaxPhysicsJobs, JPH::cMaxPhysicsBarriers, std::thread::hardware_concurrency() - 1);
|
||||
}
|
||||
|
||||
void physicsDeinit() {
|
||||
JPH::UnregisterTypes();
|
||||
delete JPH::Factory::sInstance;
|
||||
JPH::Factory::sInstance = nullptr;
|
||||
part->rigidBody._lastSize = part->size;
|
||||
if (std::shared_ptr<Part> part2 = std::dynamic_pointer_cast<Part>(part)) part->rigidBody._lastShape = part2->shape;
|
||||
}
|
||||
|
||||
tu_time_t physTime;
|
||||
|
@ -168,18 +207,31 @@ PhysJoint PhysWorld::createJoint(PhysJointInfo& type, std::shared_ptr<BasePart>
|
|||
) { Logger::fatalError("Failed to create joint between two parts due to the call being invalid"); panic(); };
|
||||
|
||||
JPH::TwoBodyConstraint* constraint;
|
||||
if (PhysJointGlueInfo* info = dynamic_cast<PhysJointGlueInfo*>(&type)) {
|
||||
if (PhysFixedJointInfo* info = dynamic_cast<PhysFixedJointInfo*>(&type)) {
|
||||
JPH::FixedConstraintSettings settings;
|
||||
settings.mAutoDetectPoint = true; // TODO: Replace this with anchor point
|
||||
settings.mSpace = JPH::EConstraintSpace::LocalToBodyCOM;
|
||||
settings.mPoint1 = convert<JPH::Vec3>(info->c0.Position());
|
||||
settings.mAxisX1 = convert<JPH::Vec3>(info->c0.RightVector());
|
||||
settings.mAxisY1 = convert<JPH::Vec3>(info->c0.UpVector());
|
||||
settings.mPoint2 = convert<JPH::Vec3>(info->c1.Position());
|
||||
settings.mAxisX2 = convert<JPH::Vec3>(info->c1.RightVector());
|
||||
settings.mAxisY2 = convert<JPH::Vec3>(info->c1.UpVector());
|
||||
constraint = settings.Create(*part0->rigidBody.bodyImpl, *part1->rigidBody.bodyImpl);
|
||||
} else if (PhysJointWeldInfo* info = dynamic_cast<PhysJointWeldInfo*>(&type)) {
|
||||
JPH::FixedConstraintSettings settings;
|
||||
settings.mAutoDetectPoint = true; // TODO: Replace this with anchor point
|
||||
constraint = settings.Create(*part0->rigidBody.bodyImpl, *part1->rigidBody.bodyImpl);
|
||||
} else if (PhysJointSnapInfo* info = dynamic_cast<PhysJointSnapInfo*>(&type)) {
|
||||
JPH::FixedConstraintSettings settings;
|
||||
settings.mAutoDetectPoint = true; // TODO: Replace this with anchor point
|
||||
} else if (PhysRotatingJointInfo* info = dynamic_cast<PhysRotatingJointInfo*>(&type)) {
|
||||
JPH::HingeConstraintSettings settings;
|
||||
settings.mSpace = JPH::EConstraintSpace::LocalToBodyCOM;
|
||||
settings.mPoint1 = convert<JPH::Vec3>(info->c0.Position());
|
||||
settings.mNormalAxis1 = convert<JPH::Vec3>(info->c0.RightVector());
|
||||
settings.mHingeAxis1 = convert<JPH::Vec3>(info->c0.LookVector());
|
||||
settings.mPoint2 = convert<JPH::Vec3>(info->c1.Position());
|
||||
settings.mNormalAxis2 = convert<JPH::Vec3>(info->c1.RightVector());
|
||||
settings.mHingeAxis2 = convert<JPH::Vec3>(info->c1.LookVector());
|
||||
// settings.mMotorSettings = JPH::MotorSettings(1.0f, 1.0f);
|
||||
constraint = settings.Create(*part0->rigidBody.bodyImpl, *part1->rigidBody.bodyImpl);
|
||||
if (info->motorized) {
|
||||
static_cast<JPH::HingeConstraint*>(constraint)->SetMotorState(JPH::EMotorState::Velocity);
|
||||
static_cast<JPH::HingeConstraint*>(constraint)->SetTargetAngularVelocity(-info->initialVelocity);
|
||||
}
|
||||
} else {
|
||||
panic();
|
||||
}
|
||||
|
@ -188,6 +240,14 @@ PhysJoint PhysWorld::createJoint(PhysJointInfo& type, std::shared_ptr<BasePart>
|
|||
return { constraint };
|
||||
}
|
||||
|
||||
// WATCH OUT! This should only be called for HingeConstraints.
|
||||
// Can't use dynamic_cast because TwoBodyConstraint is not virtual
|
||||
void PhysJoint::setAngularVelocity(float velocity) {
|
||||
JPH::HingeConstraint* constraint = static_cast<JPH::HingeConstraint*>(jointImpl);
|
||||
if (!constraint) return;
|
||||
constraint->SetTargetAngularVelocity(-velocity);
|
||||
}
|
||||
|
||||
void PhysWorld::destroyJoint(PhysJoint joint) {
|
||||
worldImpl.RemoveConstraint(joint.jointImpl);
|
||||
}
|
||||
|
@ -247,6 +307,7 @@ JPH::BroadPhaseLayer BroadPhaseLayerInterface::GetBroadPhaseLayer(JPH::ObjectLay
|
|||
switch (inLayer) {
|
||||
case Layers::DYNAMIC: return BPLayers::DYNAMIC;
|
||||
case Layers::ANCHORED: return BPLayers::ANCHORED;
|
||||
case Layers::NOCOLLIDE: return BPLayers::NOCOLLIDE;
|
||||
default: panic();
|
||||
}
|
||||
}
|
||||
|
@ -256,12 +317,19 @@ const char * BroadPhaseLayerInterface::GetBroadPhaseLayerName(JPH::BroadPhaseLay
|
|||
switch ((T)inLayer) {
|
||||
case (T)BPLayers::DYNAMIC: return "DYNAMIC";
|
||||
case (T)BPLayers::ANCHORED: return "ANCHORED";
|
||||
case (T)BPLayers::NOCOLLIDE: return "NOCOLLIDE";
|
||||
default: panic();
|
||||
}
|
||||
}
|
||||
|
||||
bool ObjectBroadPhaseFilter::ShouldCollide(JPH::ObjectLayer inLayer1, JPH::BroadPhaseLayer inLayer2) const {
|
||||
return true;
|
||||
using T = JPH::BroadPhaseLayer::Type;
|
||||
switch ((T)inLayer2) {
|
||||
case (T)BPLayers::DYNAMIC: return true;
|
||||
case (T)BPLayers::ANCHORED: return true;
|
||||
case (T)BPLayers::NOCOLLIDE: return false;
|
||||
default: panic();
|
||||
}
|
||||
}
|
||||
|
||||
bool ObjectLayerPairFilter::ShouldCollide(JPH::ObjectLayer inLayer1, JPH::ObjectLayer inLayer2) const {
|
||||
|
@ -270,6 +338,8 @@ bool ObjectLayerPairFilter::ShouldCollide(JPH::ObjectLayer inLayer1, JPH::Object
|
|||
return true;
|
||||
case Layers::ANCHORED:
|
||||
return inLayer2 == Layers::DYNAMIC;
|
||||
case Layers::NOCOLLIDE:
|
||||
return false;
|
||||
default:
|
||||
panic();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "datatypes/cframe.h"
|
||||
#include "datatypes/vector.h"
|
||||
#include "enum/part.h"
|
||||
#include "utils.h"
|
||||
|
@ -16,16 +17,30 @@ class BasePart;
|
|||
class PhysWorld;
|
||||
|
||||
struct PhysJointInfo { virtual ~PhysJointInfo() = default; protected: PhysJointInfo() = default; };
|
||||
struct PhysJointGlueInfo : PhysJointInfo { Vector3 anchorPoint; inline PhysJointGlueInfo(Vector3 anchorPoint) : anchorPoint(anchorPoint) {} };
|
||||
struct PhysJointWeldInfo : PhysJointInfo { Vector3 anchorPoint; inline PhysJointWeldInfo(Vector3 anchorPoint) : anchorPoint(anchorPoint) {} };
|
||||
struct PhysJointSnapInfo : PhysJointInfo { Vector3 anchorPoint; inline PhysJointSnapInfo(Vector3 anchorPoint) : anchorPoint(anchorPoint) {} };
|
||||
struct PhysJointHingeInfo : PhysJointInfo { Vector3 anchorPoint; Vector3 rotationAxis; inline PhysJointHingeInfo(Vector3 anchorPoint, Vector3 rotationAxis) : anchorPoint(anchorPoint), rotationAxis(rotationAxis) {} };
|
||||
struct PhysJointMotorInfo : PhysJointInfo { Vector3 anchorPoint; Vector3 rotationAxis; inline PhysJointMotorInfo(Vector3 anchorPoint, Vector3 rotationAxis) : anchorPoint(anchorPoint), rotationAxis(rotationAxis) {} };
|
||||
|
||||
struct PhysFixedJointInfo : PhysJointInfo {
|
||||
CFrame c0;
|
||||
CFrame c1;
|
||||
|
||||
inline PhysFixedJointInfo(CFrame c0, CFrame c1) : c0(c0), c1(c1) {}
|
||||
};
|
||||
|
||||
struct PhysRotatingJointInfo : PhysJointInfo {
|
||||
CFrame c0;
|
||||
CFrame c1;
|
||||
bool motorized;
|
||||
float initialVelocity;
|
||||
|
||||
inline PhysRotatingJointInfo(CFrame c0, CFrame c1) : c0(c0), c1(c1), motorized(false), initialVelocity(0.f){}
|
||||
inline PhysRotatingJointInfo(CFrame c0, CFrame c1, float initialVelocity) : c0(c0), c1(c1), motorized(true), initialVelocity(initialVelocity) {}
|
||||
};
|
||||
|
||||
class PhysWorld;
|
||||
struct PhysJoint {
|
||||
public:
|
||||
JPH::TwoBodyConstraint* jointImpl;
|
||||
|
||||
void setAngularVelocity(float velocity);
|
||||
};
|
||||
|
||||
struct RaycastResult;
|
||||
|
|
|
@ -2968,7 +2968,7 @@ static float OUTLINE_VERTICES[] = {
|
|||
|
||||
};
|
||||
|
||||
static float CYLINDER_VERTICES[] = {
|
||||
static float CYLINDER_CHEAP_VERTICES[] = {
|
||||
// positions // normals // texture coords
|
||||
|
||||
0.0, -0.5, 0.5, 0.2588, -0.9659, -0.0, 1.0, 0.5,
|
||||
|
@ -3106,11 +3106,391 @@ static float CYLINDER_VERTICES[] = {
|
|||
|
||||
};
|
||||
|
||||
|
||||
static float CYLINDER_VERTICES[] = {
|
||||
// positions // normals // texture coords
|
||||
|
||||
0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 1.0, 0.5,
|
||||
0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 0.5,
|
||||
-0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 1.0, 1.0,
|
||||
0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 0.5,
|
||||
0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 0.5,
|
||||
-0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 1.0,
|
||||
0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 0.5,
|
||||
0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 0.5,
|
||||
-0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 1.0,
|
||||
0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 0.5,
|
||||
0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 0.5,
|
||||
-0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 1.0,
|
||||
0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 0.5,
|
||||
0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 0.5,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 1.0,
|
||||
0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 0.5,
|
||||
0.5, 0.46194, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 0.5,
|
||||
-0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 1.0,
|
||||
0.5, 0.46194, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 0.5,
|
||||
0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 0.5,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 1.0,
|
||||
0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 0.5,
|
||||
0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 0.5,
|
||||
-0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 1.0,
|
||||
0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 0.5,
|
||||
0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 0.5,
|
||||
-0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 1.0,
|
||||
0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 0.5,
|
||||
0.5, 0.46194, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 0.5,
|
||||
-0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 1.0,
|
||||
0.5, 0.46194, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 0.5,
|
||||
0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 0.5,
|
||||
-0.5, 0.4619395, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 1.0,
|
||||
0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 0.5,
|
||||
0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 0.5,
|
||||
-0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 1.0,
|
||||
0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 0.5,
|
||||
0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 0.5,
|
||||
-0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 1.0,
|
||||
0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 0.5,
|
||||
0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 0.5,
|
||||
-0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 1.0,
|
||||
0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 0.5,
|
||||
0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 0.5,
|
||||
-0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 1.0,
|
||||
0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 0.5,
|
||||
0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 0.5,
|
||||
-0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 1.0,
|
||||
0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 0.5,
|
||||
0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 0.5,
|
||||
-0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 1.0,
|
||||
0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 0.5,
|
||||
0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 0.5,
|
||||
-0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 1.0,
|
||||
0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 0.5,
|
||||
0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 0.5,
|
||||
-0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 1.0,
|
||||
0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 0.5,
|
||||
0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 0.5,
|
||||
-0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 1.0,
|
||||
0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 0.5,
|
||||
0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 0.5,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 1.0,
|
||||
0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 0.5,
|
||||
0.5, -0.46193949999999995, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 0.5,
|
||||
-0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 1.0,
|
||||
0.5, -0.46193949999999995, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 0.5,
|
||||
0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 0.5,
|
||||
-0.5, -0.46194, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 1.0,
|
||||
0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 0.5,
|
||||
0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 0.5,
|
||||
-0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 1.0,
|
||||
0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 0.5,
|
||||
0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 0.5,
|
||||
-0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 1.0,
|
||||
0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 0.5,
|
||||
0.5, -0.46193949999999995, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 0.5,
|
||||
-0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 1.0,
|
||||
0.5, -0.46193949999999995, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 0.5,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 0.5,
|
||||
-0.5, -0.46194, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 1.0,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 0.5,
|
||||
0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 0.5,
|
||||
-0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 1.0,
|
||||
0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 0.5,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 0.5,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 1.0,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 0.5,
|
||||
0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 0.5,
|
||||
-0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 1.0,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 0.5,
|
||||
0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 0.5,
|
||||
-0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 1.0,
|
||||
0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 0.5,
|
||||
0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 0.0, 0.5,
|
||||
-0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 1.0,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 0.5,
|
||||
-0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 1.0,
|
||||
-0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 1.0, 1.0,
|
||||
0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 0.5,
|
||||
-0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 1.0,
|
||||
-0.5, 0.09754499999999999, -0.4903925, -0.0, 0.1951, -0.9808, 0.96875, 1.0,
|
||||
0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 0.5,
|
||||
-0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 1.0,
|
||||
-0.5, 0.1913415, -0.46194, -0.0, 0.3827, -0.9239, 0.9375, 1.0,
|
||||
0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 0.5,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 1.0,
|
||||
-0.5, 0.277785, -0.41573499999999997, -0.0, 0.5556, -0.8315, 0.90625, 1.0,
|
||||
0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 0.5,
|
||||
-0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 1.0,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -0.0, 0.7071, -0.7071, 0.875, 1.0,
|
||||
0.5, 0.46194, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 0.5,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 1.0,
|
||||
-0.5, 0.415735, -0.27778499999999995, -0.0, 0.8315, -0.5556, 0.84375, 1.0,
|
||||
0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 0.5,
|
||||
-0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 1.0,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -0.0, 0.9239, -0.3827, 0.8125, 1.0,
|
||||
0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 0.5,
|
||||
-0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 1.0,
|
||||
-0.5, 0.4903925, -0.09754499999999999, -0.0, 0.9808, -0.1951, 0.78125, 1.0,
|
||||
0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 0.5,
|
||||
-0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 1.0,
|
||||
-0.5, 0.5, 0.0, -0.0, 1.0, -0.0, 0.75, 1.0,
|
||||
0.5, 0.46194, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 0.5,
|
||||
-0.5, 0.4619395, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 1.0,
|
||||
-0.5, 0.4903925, 0.09754499999999999, -0.0, 0.9808, 0.1951, 0.71875, 1.0,
|
||||
0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 0.5,
|
||||
-0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 1.0,
|
||||
-0.5, 0.4619395, 0.1913415, -0.0, 0.9239, 0.3827, 0.6875, 1.0,
|
||||
0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 0.5,
|
||||
-0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 1.0,
|
||||
-0.5, 0.415735, 0.277785, -0.0, 0.8315, 0.5556, 0.65625, 1.0,
|
||||
0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 0.5,
|
||||
-0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 1.0,
|
||||
-0.5, 0.3535535, 0.3535535, -0.0, 0.7071, 0.7071, 0.625, 1.0,
|
||||
0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 0.5,
|
||||
-0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 1.0,
|
||||
-0.5, 0.277785, 0.415735, -0.0, 0.5556, 0.8315, 0.59375, 1.0,
|
||||
0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 0.5,
|
||||
-0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 1.0,
|
||||
-0.5, 0.1913415, 0.46194, -0.0, 0.3827, 0.9239, 0.5625, 1.0,
|
||||
0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 0.5,
|
||||
-0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 1.0,
|
||||
-0.5, 0.09754499999999999, 0.4903925, -0.0, 0.1951, 0.9808, 0.53125, 1.0,
|
||||
0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 0.5,
|
||||
-0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 1.0,
|
||||
-0.5, 0.0, 0.5, -0.0, -0.0, 1.0, 0.5, 1.0,
|
||||
0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 0.5,
|
||||
-0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 1.0,
|
||||
-0.5, -0.09754499999999999, 0.4903925, -0.0, -0.1951, 0.9808, 0.46875, 1.0,
|
||||
0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 0.5,
|
||||
-0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 1.0,
|
||||
-0.5, -0.19134150000000005, 0.46194, -0.0, -0.3827, 0.9239, 0.4375, 1.0,
|
||||
0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 0.5,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 1.0,
|
||||
-0.5, -0.27778499999999995, 0.415735, -0.0, -0.5556, 0.8315, 0.40625, 1.0,
|
||||
0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 0.5,
|
||||
-0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 1.0,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -0.0, -0.7071, 0.7071, 0.375, 1.0,
|
||||
0.5, -0.46193949999999995, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 0.5,
|
||||
-0.5, -0.46194, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 1.0,
|
||||
-0.5, -0.41573499999999997, 0.277785, -0.0, -0.8315, 0.5556, 0.34375, 1.0,
|
||||
0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 0.5,
|
||||
-0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 1.0,
|
||||
-0.5, -0.46194, 0.1913415, -0.0, -0.9239, 0.3827, 0.3125, 1.0,
|
||||
0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 0.5,
|
||||
-0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 1.0,
|
||||
-0.5, -0.4903925, 0.09754499999999999, -0.0, -0.9808, 0.1951, 0.28125, 1.0,
|
||||
0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 0.5,
|
||||
-0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 1.0,
|
||||
-0.5, -0.5, 0.0, -0.0, -1.0, -0.0, 0.25, 1.0,
|
||||
0.5, -0.46193949999999995, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 0.5,
|
||||
-0.5, -0.46194, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 1.0,
|
||||
-0.5, -0.4903925, -0.09754499999999999, -0.0, -0.9808, -0.1951, 0.21875, 1.0,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 0.5,
|
||||
-0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 1.0,
|
||||
-0.5, -0.46194, -0.19134150000000005, -0.0, -0.9239, -0.3827, 0.1875, 1.0,
|
||||
0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 0.5,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 1.0,
|
||||
-0.5, -0.41573499999999997, -0.27778499999999995, -0.0, -0.8315, -0.5556, 0.15625, 1.0,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 0.5,
|
||||
-0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 1.0,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -0.0, -0.7071, -0.7071, 0.125, 1.0,
|
||||
0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 0.5,
|
||||
-0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 1.0,
|
||||
-0.5, -0.27778499999999995, -0.41573499999999997, -0.0, -0.5556, -0.8315, 0.09375, 1.0,
|
||||
-0.5, 0.0, -0.5, -1.0, -0.0, -0.0, 0.25, 0.49,
|
||||
-0.5, 0.09754499999999999, -0.4903925, -1.0, -0.0, -0.0, 0.296822, 0.485388,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, -0.09754499999999999, -0.4903925, -1.0, -0.0, -0.0, 0.203178, 0.485388,
|
||||
-0.5, 0.0, -0.5, -1.0, -0.0, -0.0, 0.25, 0.49,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, -0.19134150000000005, -0.46194, -1.0, -0.0, -0.0, 0.158156, 0.471731,
|
||||
-0.5, -0.09754499999999999, -0.4903925, -1.0, -0.0, -0.0, 0.203178, 0.485388,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -1.0, -0.0, -0.0, 0.080294, 0.419706,
|
||||
-0.5, -0.27778499999999995, -0.41573499999999997, -1.0, -0.0, -0.0, 0.116663, 0.449553,
|
||||
-0.5, -0.19134150000000005, -0.46194, -1.0, -0.0, -0.0, 0.158156, 0.471731,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.41573499999999997, -0.27778499999999995, -1.0, -0.0, -0.0, 0.050447, 0.383337,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -1.0, -0.0, -0.0, 0.080294, 0.419706,
|
||||
-0.5, -0.5, 0.0, -1.0, -0.0, -0.0, 0.01, 0.25,
|
||||
-0.5, -0.4903925, -0.09754499999999999, -1.0, -0.0, -0.0, 0.014612, 0.296822,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.4903925, 0.09754499999999999, -1.0, -0.0, -0.0, 0.014612, 0.203178,
|
||||
-0.5, -0.5, 0.0, -1.0, -0.0, -0.0, 0.01, 0.25,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.46194, 0.1913415, -1.0, -0.0, -0.0, 0.028269, 0.158156,
|
||||
-0.5, -0.4903925, 0.09754499999999999, -1.0, -0.0, -0.0, 0.014612, 0.203178,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -1.0, -0.0, -0.0, 0.080294, 0.080294,
|
||||
-0.5, -0.41573499999999997, 0.277785, -1.0, -0.0, -0.0, 0.050447, 0.116663,
|
||||
-0.5, -0.46194, 0.1913415, -1.0, -0.0, -0.0, 0.028269, 0.158156,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, -0.27778499999999995, 0.415735, -1.0, -0.0, -0.0, 0.116663, 0.050447,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -1.0, -0.0, -0.0, 0.080294, 0.080294,
|
||||
-0.5, 0.1913415, 0.46194, -1.0, -0.0, -0.0, 0.341844, 0.028269,
|
||||
-0.5, -0.09754499999999999, 0.4903925, -1.0, -0.0, -0.0, 0.203178, 0.014612,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, 0.1913415, 0.46194, -1.0, -0.0, -0.0, 0.341844, 0.028269,
|
||||
-0.5, 0.0, 0.5, -1.0, -0.0, -0.0, 0.25, 0.01,
|
||||
-0.5, -0.09754499999999999, 0.4903925, -1.0, -0.0, -0.0, 0.203178, 0.014612,
|
||||
-0.5, 0.1913415, 0.46194, -1.0, -0.0, -0.0, 0.341844, 0.028269,
|
||||
-0.5, 0.09754499999999999, 0.4903925, -1.0, -0.0, -0.0, 0.296822, 0.014612,
|
||||
-0.5, 0.0, 0.5, -1.0, -0.0, -0.0, 0.25, 0.01,
|
||||
-0.5, 0.3535535, 0.3535535, -1.0, -0.0, -0.0, 0.419706, 0.080294,
|
||||
-0.5, 0.277785, 0.415735, -1.0, -0.0, -0.0, 0.383337, 0.050447,
|
||||
-0.5, 0.1913415, 0.46194, -1.0, -0.0, -0.0, 0.341844, 0.028269,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, 0.415735, 0.277785, -1.0, -0.0, -0.0, 0.449553, 0.116663,
|
||||
-0.5, 0.3535535, 0.3535535, -1.0, -0.0, -0.0, 0.419706, 0.080294,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -1.0, -0.0, -0.0, 0.471731, 0.341844,
|
||||
-0.5, 0.4903925, 0.09754499999999999, -1.0, -0.0, -0.0, 0.485388, 0.203178,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -1.0, -0.0, -0.0, 0.471731, 0.341844,
|
||||
-0.5, 0.5, 0.0, -1.0, -0.0, -0.0, 0.49, 0.25,
|
||||
-0.5, 0.4903925, 0.09754499999999999, -1.0, -0.0, -0.0, 0.485388, 0.203178,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -1.0, -0.0, -0.0, 0.471731, 0.341844,
|
||||
-0.5, 0.4903925, -0.09754499999999999, -1.0, -0.0, -0.0, 0.485388, 0.296822,
|
||||
-0.5, 0.5, 0.0, -1.0, -0.0, -0.0, 0.49, 0.25,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -1.0, -0.0, -0.0, 0.419706, 0.419706,
|
||||
-0.5, 0.415735, -0.27778499999999995, -1.0, -0.0, -0.0, 0.449553, 0.383337,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -1.0, -0.0, -0.0, 0.471731, 0.341844,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, 0.277785, -0.41573499999999997, -1.0, -0.0, -0.0, 0.383337, 0.449553,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -1.0, -0.0, -0.0, 0.419706, 0.419706,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -1.0, -0.0, -0.0, 0.080294, 0.419706,
|
||||
-0.5, -0.19134150000000005, -0.46194, -1.0, -0.0, -0.0, 0.158156, 0.471731,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.3535535000000001, -0.3535535000000001, -1.0, -0.0, -0.0, 0.080294, 0.419706,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -1.0, -0.0, -0.0, 0.080294, 0.080294,
|
||||
-0.5, -0.46194, 0.1913415, -1.0, -0.0, -0.0, 0.028269, 0.158156,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, -0.3535535000000001, 0.3535535, -1.0, -0.0, -0.0, 0.080294, 0.080294,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, 0.3535535, 0.3535535, -1.0, -0.0, -0.0, 0.419706, 0.080294,
|
||||
-0.5, 0.1913415, 0.46194, -1.0, -0.0, -0.0, 0.341844, 0.028269,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, 0.3535535, 0.3535535, -1.0, -0.0, -0.0, 0.419706, 0.080294,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -1.0, -0.0, -0.0, 0.419706, 0.419706,
|
||||
-0.5, 0.4619395, -0.19134150000000005, -1.0, -0.0, -0.0, 0.471731, 0.341844,
|
||||
-0.5, 0.4619395, 0.1913415, -1.0, -0.0, -0.0, 0.471731, 0.158156,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
-0.5, 0.3535535, -0.3535535000000001, -1.0, -0.0, -0.0, 0.419706, 0.419706,
|
||||
-0.5, -0.19134150000000005, 0.46194, -1.0, -0.0, -0.0, 0.158156, 0.028269,
|
||||
-0.5, -0.46194, -0.19134150000000005, -1.0, -0.0, -0.0, 0.028269, 0.341844,
|
||||
-0.5, 0.1913415, -0.46194, -1.0, -0.0, -0.0, 0.341844, 0.471731,
|
||||
0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 0.5,
|
||||
-0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 1.0,
|
||||
-0.5, -0.19134150000000005, -0.46194, -0.0, -0.3827, -0.9239, 0.0625, 1.0,
|
||||
0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 0.0, 0.5,
|
||||
-0.5, 0.0, -0.5, -0.0, -0.0, -1.0, 0.0, 1.0,
|
||||
-0.5, -0.09754499999999999, -0.4903925, -0.0, -0.1951, -0.9808, 0.03125, 1.0,
|
||||
0.5, 0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.485388,
|
||||
0.5, 0.0, -0.5, 1.0, -0.0, -0.0, 0.75, 0.49,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, 0.277785, -0.41573499999999997, 1.0, -0.0, -0.0, 0.883337, 0.449553,
|
||||
0.5, 0.1913415, -0.46194, 1.0, -0.0, -0.0, 0.841844, 0.471731,
|
||||
0.5, 0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.485388,
|
||||
0.5, 0.415735, -0.27778499999999995, 1.0, -0.0, -0.0, 0.949553, 0.383337,
|
||||
0.5, 0.3535535, -0.3535535000000001, 1.0, -0.0, -0.0, 0.919706, 0.419706,
|
||||
0.5, 0.277785, -0.41573499999999997, 1.0, -0.0, -0.0, 0.883337, 0.449553,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.46194, -0.19134150000000005, 1.0, -0.0, -0.0, 0.971731, 0.341844,
|
||||
0.5, 0.415735, -0.27778499999999995, 1.0, -0.0, -0.0, 0.949553, 0.383337,
|
||||
0.5, 0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.203178,
|
||||
0.5, 0.5, 0.0, 1.0, -0.0, -0.0, 0.99, 0.25,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.415735, 0.277785, 1.0, -0.0, -0.0, 0.949553, 0.116663,
|
||||
0.5, 0.46194, 0.1913415, 1.0, -0.0, -0.0, 0.971731, 0.158156,
|
||||
0.5, 0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.203178,
|
||||
0.5, 0.277785, 0.415735, 1.0, -0.0, -0.0, 0.883337, 0.050447,
|
||||
0.5, 0.3535535, 0.3535535, 1.0, -0.0, -0.0, 0.919706, 0.080294,
|
||||
0.5, 0.415735, 0.277785, 1.0, -0.0, -0.0, 0.949553, 0.116663,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.1913415, 0.46194, 1.0, -0.0, -0.0, 0.841844, 0.028269,
|
||||
0.5, 0.277785, 0.415735, 1.0, -0.0, -0.0, 0.883337, 0.050447,
|
||||
0.5, -0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.014612,
|
||||
0.5, 0.0, 0.5, 1.0, -0.0, -0.0, 0.75, 0.01,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, -0.27778499999999995, 0.415735, 1.0, -0.0, -0.0, 0.616663, 0.050447,
|
||||
0.5, -0.19134150000000005, 0.46194, 1.0, -0.0, -0.0, 0.658156, 0.028269,
|
||||
0.5, -0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.014612,
|
||||
0.5, -0.41573499999999997, 0.277785, 1.0, -0.0, -0.0, 0.550447, 0.116663,
|
||||
0.5, -0.3535535000000001, 0.3535535, 1.0, -0.0, -0.0, 0.580294, 0.080294,
|
||||
0.5, -0.27778499999999995, 0.415735, 1.0, -0.0, -0.0, 0.616663, 0.050447,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.46193949999999995, 0.1913415, 1.0, -0.0, -0.0, 0.528269, 0.158156,
|
||||
0.5, -0.41573499999999997, 0.277785, 1.0, -0.0, -0.0, 0.550447, 0.116663,
|
||||
0.5, -0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.296822,
|
||||
0.5, -0.5, 0.0, 1.0, -0.0, -0.0, 0.51, 0.25,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, 1.0, -0.0, -0.0, 0.550447, 0.383337,
|
||||
0.5, -0.46193949999999995, -0.19134150000000005, 1.0, -0.0, -0.0, 0.528269, 0.341844,
|
||||
0.5, -0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.296822,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, 1.0, -0.0, -0.0, 0.616663, 0.449553,
|
||||
0.5, -0.3535535000000001, -0.3535535000000001, 1.0, -0.0, -0.0, 0.580294, 0.419706,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, 1.0, -0.0, -0.0, 0.550447, 0.383337,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, -0.19134150000000005, -0.46194, 1.0, -0.0, -0.0, 0.658156, 0.471731,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, 1.0, -0.0, -0.0, 0.616663, 0.449553,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.485388,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.277785, -0.41573499999999997, 1.0, -0.0, -0.0, 0.883337, 0.449553,
|
||||
0.5, 0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.485388,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.415735, -0.27778499999999995, 1.0, -0.0, -0.0, 0.949553, 0.383337,
|
||||
0.5, 0.277785, -0.41573499999999997, 1.0, -0.0, -0.0, 0.883337, 0.449553,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.203178,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.415735, 0.277785, 1.0, -0.0, -0.0, 0.949553, 0.116663,
|
||||
0.5, 0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.203178,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.277785, 0.415735, 1.0, -0.0, -0.0, 0.883337, 0.050447,
|
||||
0.5, 0.415735, 0.277785, 1.0, -0.0, -0.0, 0.949553, 0.116663,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.014612,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.27778499999999995, 0.415735, 1.0, -0.0, -0.0, 0.616663, 0.050447,
|
||||
0.5, -0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.014612,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.41573499999999997, 0.277785, 1.0, -0.0, -0.0, 0.550447, 0.116663,
|
||||
0.5, -0.27778499999999995, 0.415735, 1.0, -0.0, -0.0, 0.616663, 0.050447,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, -0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.296822,
|
||||
0.5, -0.4903925, 0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.203178,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, 1.0, -0.0, -0.0, 0.550447, 0.383337,
|
||||
0.5, -0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.514612, 0.296822,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
0.5, -0.27778499999999995, -0.41573499999999997, 1.0, -0.0, -0.0, 0.616663, 0.449553,
|
||||
0.5, -0.41573499999999997, -0.27778499999999995, 1.0, -0.0, -0.0, 0.550447, 0.383337,
|
||||
0.5, 0.09754499999999999, 0.4903925, 1.0, -0.0, -0.0, 0.796822, 0.014612,
|
||||
0.5, 0.4903925, -0.09754499999999999, 1.0, -0.0, -0.0, 0.985388, 0.296822,
|
||||
0.5, -0.09754499999999999, -0.4903925, 1.0, -0.0, -0.0, 0.703178, 0.485388,
|
||||
|
||||
};
|
||||
|
||||
Mesh* CUBE_MESH;
|
||||
Mesh* WEDGE_MESH;
|
||||
Mesh* SPHERE_MESH;
|
||||
Mesh* ARROW_MESH;
|
||||
Mesh* OUTLINE_MESH;
|
||||
Mesh* CYLINDER_CHEAP_MESH;
|
||||
Mesh* CYLINDER_MESH;
|
||||
|
||||
void initMeshes() {
|
||||
|
@ -3119,6 +3499,7 @@ void initMeshes() {
|
|||
SPHERE_MESH = new Mesh(sizeof(SPHERE_VERTICES) / sizeof(float) / 8, SPHERE_VERTICES);
|
||||
ARROW_MESH = new Mesh(sizeof(ARROW_VERTICES) / sizeof(float) / 8, ARROW_VERTICES);
|
||||
OUTLINE_MESH = new Mesh(sizeof(OUTLINE_VERTICES) / sizeof(float) / 8, OUTLINE_VERTICES);
|
||||
CYLINDER_CHEAP_MESH = new Mesh(sizeof(CYLINDER_CHEAP_VERTICES) / sizeof(float) / 8, CYLINDER_CHEAP_VERTICES);
|
||||
CYLINDER_MESH = new Mesh(sizeof(CYLINDER_VERTICES) / sizeof(float) / 8, CYLINDER_VERTICES);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,5 +7,6 @@ extern Mesh* SPHERE_MESH;
|
|||
extern Mesh* ARROW_MESH;
|
||||
extern Mesh* OUTLINE_MESH;
|
||||
extern Mesh* CYLINDER_MESH;
|
||||
extern Mesh* CYLINDER_CHEAP_MESH;
|
||||
|
||||
void initMeshes();
|
|
@ -5,6 +5,7 @@
|
|||
#include <glm/ext/matrix_clip_space.hpp>
|
||||
#include <glm/ext/matrix_float4x4.hpp>
|
||||
#include <glm/ext/matrix_transform.hpp>
|
||||
#include <glm/ext/scalar_constants.hpp>
|
||||
#include <glm/ext/vector_float3.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
|
@ -157,6 +158,10 @@ static void renderPart(std::shared_ptr<BasePart> part) {
|
|||
glFrontFace(GL_CW);
|
||||
CUBE_MESH->bind();
|
||||
glDrawArrays(GL_TRIANGLES, 0, CUBE_MESH->vertexCount);
|
||||
} else if (shape == PartType::Cylinder) {
|
||||
glFrontFace(GL_CW);
|
||||
CYLINDER_MESH->bind();
|
||||
glDrawArrays(GL_TRIANGLES, 0, CYLINDER_MESH->vertexCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,8 +264,8 @@ void renderSurfaceExtras() {
|
|||
model = glm::scale(model, glm::vec3(0.4,0.4,0.4));
|
||||
ghostShader->set("model", model);
|
||||
|
||||
CYLINDER_MESH->bind();
|
||||
glDrawArrays(GL_TRIANGLES, 0, CYLINDER_MESH->vertexCount);
|
||||
CYLINDER_CHEAP_MESH->bind();
|
||||
glDrawArrays(GL_TRIANGLES, 0, CYLINDER_CHEAP_MESH->vertexCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,18 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
});
|
||||
|
||||
setUpCommandBar();
|
||||
|
||||
#ifndef NDEBUG
|
||||
// https://stackoverflow.com/a/17631703/16255372
|
||||
// Add shortcut for reloading most recent file
|
||||
QAction* reloadMostRecent = new QAction();
|
||||
reloadMostRecent->setShortcut(Qt::Key_R | Qt::CTRL);
|
||||
connect(reloadMostRecent, &QAction::triggered, [this, reloadMostRecent]() {
|
||||
recentsMenu->actions()[0]->trigger();
|
||||
removeAction(reloadMostRecent);
|
||||
});
|
||||
addAction(reloadMostRecent);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* evt) {
|
||||
|
|
Loading…
Add table
Reference in a new issue