< /blockquote>
Я имею: < /p>
- Настройка физики Jolt с использованием vcpkg
- Скомпилировал пакет с использованием cmake
- Связал скомпилированную библиотеку (jolt.lib), справа < br/>
Есть ли что -то, что я скучаю?
Вот какой -то код из моего проекта: < /p>
// Collider.h
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace BlockyBuild {
enum ColliderTypes {
BoxCollider,
TriangleCollider
};
class Collider {
ColliderTypes type;
JPH::Vec3 scale;
JPH::Vec3 center;
JPH::Ref shape;
public:
ColliderTypes getType() const;
JPH::Vec3 getScale() const;
void setScale(const JPH::Vec3Arg scale);
JPH::Vec3 getCenter() const;
void setShape(const JPH::Ref& shape);
JPH::Ref getShape() const;
bool operator==(const Collider& collider) const;
Collider& operator=(const Collider& other);
Collider(const Collider& other);
Collider(const ColliderTypes type, const JPH::Vec3Arg scale, const JPH::Vec3Arg center = {0, 0, 0});
};
}
// Collider.cpp
#include "Collider.h"
namespace BlockyBuild {
ColliderTypes Collider::getType() const {
return type;
}
bool Collider::operator==(const Collider& collider) const {
if (shape == collider.shape)
return true;
return false;
}
JPH::Vec3 Collider::getScale() const {
return scale;
}
void Collider::setScale(const JPH::Vec3Arg scale) {
this->scale = scale;
}
JPH::Vec3 Collider::getCenter() const {
return center;
}
Collider::Collider(const Collider& other)
: type(other.type), scale(other.scale), center(other.center), shape(other.shape) {
if (shape) {
std::cerr
Подробнее здесь: https://stackoverflow.com/questions/794 ... lt-physics