| 198 | } |
| 199 | |
| 200 | void Collider::CreateShape() |
| 201 | { |
| 202 | ASSERT(_shape == nullptr); |
| 203 | |
| 204 | // Setup shape geometry |
| 205 | _cachedScale = GetScale().GetAbsolute().MaxValue(); |
| 206 | CollisionShape shape; |
| 207 | GetGeometry(shape); |
| 208 | |
| 209 | // Create shape |
| 210 | const bool isTrigger = _isTrigger && CanBeTrigger(); |
| 211 | _shape = PhysicsBackend::CreateShape(this, shape, Material, IsActiveInHierarchy(), isTrigger); |
| 212 | if (!_shape) |
| 213 | { |
| 214 | LOG(Error, "Failed to create physics shape for actor '{}'", GetNamePath()); |
| 215 | if (shape.Type == CollisionShape::Types::ConvexMesh && Float3(shape.ConvexMesh.Scale).MinValue() <= 0) |
| 216 | LOG(Warning, "Convex Mesh colliders cannot have negative scale"); |
| 217 | return; |
| 218 | } |
| 219 | PhysicsBackend::SetShapeContactOffset(_shape, _contactOffset); |
| 220 | UpdateLayerBits(); |
| 221 | } |
| 222 | |
| 223 | void Collider::UpdateGeometry() |
| 224 | { |
nothing calls this directly
no test coverage detected