Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties Struct Reference

Collision shape properties imported from Blender. More...

#include <GltfLoader.h>

Collaboration diagram for Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties:

Classes

struct  CompoundChild
 Child shape data for compound collision. More...

Public Types

enum class  ShapeType {
  NONE ,
  BOX ,
  SPHERE ,
  CAPSULE ,
  CONVEX_HULL ,
  TRIANGLE_MESH ,
  COMPOUND
}
 Collision shape type imported from the engine glTF extension. More...

Public Member Functions

 CollisionProperties ()=default
 Creates collision settings with collision disabled.
 CollisionProperties (const tinygltf::Value &extension, const tinygltf::Model *model=nullptr)
 Parses collisionProperties from the engine extension.
bool hasCollision () const
 Checks whether this record describes a collision shape.

Public Attributes

ShapeType shapeType = ShapeType::NONE
 Shape type selected by collisionType.
bool generateConvexHull = false
 True when runtime collision generation should build a convex hull.
std::string collisionProfile
 Named collision response profile imported from the authoring tool.
glm::vec3 offset { 0.0f }
 Local collision shape offset in node space.
glm::vec3 boxHalfExtents { 0.5f }
 Half extents for box collision.
float sphereRadius = 0.5f
 Radius for sphere collision.
float capsuleRadius = 0.5f
 Radius for capsule collision.
float capsuleHeight = 1.0f
 Height for capsule collision.
std::vector< glm::vec3 > vertices
 Collision vertices for convex hull and triangle mesh shapes.
std::vector< uint32_t > indices
 Triangle indices for triangle mesh collision.
std::vector< CompoundChild > compoundChildren
 Compound collision children.

Static Private Member Functions

static ShapeType parseShapeType (const std::string &typeStr)

Detailed Description

Collision shape properties imported from Blender.

Supports primitive shapes, convex hulls, triangle meshes, and compound shapes from VSC_-prefixed meshes.

Definition at line 385 of file GltfLoader.h.

Member Enumeration Documentation

◆ ShapeType

Collision shape type imported from the engine glTF extension.

Enumerator
NONE 

No collision shape was authored.

BOX 

Axis-aligned box shape using boxHalfExtents.

SPHERE 

Sphere shape using sphereRadius.

CAPSULE 

Capsule shape using capsuleRadius and capsuleHeight.

CONVEX_HULL 

Convex hull built from imported vertices.

TRIANGLE_MESH 

Triangle mesh built from imported vertices and indices.

COMPOUND 

Compound shape assembled from child collision meshes.

Definition at line 390 of file GltfLoader.h.

Constructor & Destructor Documentation

◆ CollisionProperties() [1/2]

Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::CollisionProperties ( )
default

Creates collision settings with collision disabled.

◆ CollisionProperties() [2/2]

Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::CollisionProperties ( const tinygltf::Value & extension,
const tinygltf::Model * model = nullptr )
explicit

Parses collisionProperties from the engine extension.

Parameters
extensionJSON object containing collision shape settings.
modelOptional model used when compound children reference binary accessors.

Member Function Documentation

◆ hasCollision()

bool Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::hasCollision ( ) const
inlinenodiscard

Checks whether this record describes a collision shape.

Returns
True when shapeType is not ShapeType::NONE.

Definition at line 521 of file GltfLoader.h.

References NONE, and shapeType.

◆ parseShapeType()

ShapeType Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::parseShapeType ( const std::string & typeStr)
staticprivate

Member Data Documentation

◆ boxHalfExtents

glm::vec3 Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::boxHalfExtents { 0.5f }

Half extents for box collision.

Definition at line 447 of file GltfLoader.h.

◆ capsuleHeight

float Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::capsuleHeight = 1.0f

Height for capsule collision.

Definition at line 462 of file GltfLoader.h.

◆ capsuleRadius

float Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::capsuleRadius = 0.5f

Radius for capsule collision.

Definition at line 457 of file GltfLoader.h.

◆ collisionProfile

std::string Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::collisionProfile

Named collision response profile imported from the authoring tool.

Definition at line 436 of file GltfLoader.h.

◆ compoundChildren

std::vector<CompoundChild> Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::compoundChildren

Compound collision children.

Definition at line 515 of file GltfLoader.h.

◆ generateConvexHull

bool Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::generateConvexHull = false

True when runtime collision generation should build a convex hull.

Definition at line 431 of file GltfLoader.h.

◆ indices

std::vector<uint32_t> Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::indices

Triangle indices for triangle mesh collision.

Definition at line 473 of file GltfLoader.h.

◆ offset

glm::vec3 Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::offset { 0.0f }

Local collision shape offset in node space.

Definition at line 441 of file GltfLoader.h.

◆ shapeType

ShapeType Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::shapeType = ShapeType::NONE

Shape type selected by collisionType.

Definition at line 426 of file GltfLoader.h.

Referenced by hasCollision().

◆ sphereRadius

float Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::sphereRadius = 0.5f

Radius for sphere collision.

Definition at line 452 of file GltfLoader.h.

◆ vertices

std::vector<glm::vec3> Engine::Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties::vertices

Collision vertices for convex hull and triangle mesh shapes.

Definition at line 468 of file GltfLoader.h.


The documentation for this struct was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Mesh/GltfLoader.h