Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
AllowedDOFs.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2023 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10enum class EAllowedDOFs : uint8
11{
12 None = 0b000000,
13 All = 0b111111,
14 TranslationX = 0b000001,
15 TranslationY = 0b000010,
16 TranslationZ = 0b000100,
17 RotationX = 0b001000,
18 RotationY = 0b010000,
19 RotationZ = 0b100000,
21};
22
25{
26 return EAllowedDOFs(uint8(inLHS) | uint8(inRHS));
27}
28
31{
32 return EAllowedDOFs(uint8(inLHS) & uint8(inRHS));
33}
34
37{
38 return EAllowedDOFs(uint8(inLHS) ^ uint8(inRHS));
39}
40
42constexpr EAllowedDOFs operator ~ (EAllowedDOFs inAllowedDOFs)
43{
44 return EAllowedDOFs(~uint8(inAllowedDOFs));
45}
46
49{
50 ioLHS = ioLHS | inRHS;
51 return ioLHS;
52}
53
56{
57 ioLHS = ioLHS & inRHS;
58 return ioLHS;
59}
60
63{
64 ioLHS = ioLHS ^ inRHS;
65 return ioLHS;
66}
67
constexpr EAllowedDOFs & operator&=(EAllowedDOFs &ioLHS, EAllowedDOFs inRHS)
Bitwise AND assignment operator for EAllowedDOFs.
Definition: AllowedDOFs.h:55
constexpr EAllowedDOFs operator^(EAllowedDOFs inLHS, EAllowedDOFs inRHS)
Bitwise XOR operator for EAllowedDOFs.
Definition: AllowedDOFs.h:36
EAllowedDOFs
Enum used in BodyCreationSettings and MotionProperties to indicate which degrees of freedom a body ha...
Definition: AllowedDOFs.h:11
@ RotationX
Body can rotate around world space X axis.
@ TranslationY
Body can move in world space Y axis.
@ None
No degrees of freedom are allowed. Note that this is not valid and will crash. Use a static body inst...
@ RotationY
Body can rotate around world space Y axis.
@ TranslationZ
Body can move in world space Z axis.
@ All
All degrees of freedom are allowed.
@ Plane2D
Body can only move in X and Y axis and rotate around Z axis.
@ TranslationX
Body can move in world space X axis.
@ RotationZ
Body can rotate around world space Z axis.
constexpr EAllowedDOFs operator~(EAllowedDOFs inAllowedDOFs)
Bitwise NOT operator for EAllowedDOFs.
Definition: AllowedDOFs.h:42
constexpr EAllowedDOFs operator|(EAllowedDOFs inLHS, EAllowedDOFs inRHS)
Bitwise OR operator for EAllowedDOFs.
Definition: AllowedDOFs.h:24
constexpr EAllowedDOFs & operator^=(EAllowedDOFs &ioLHS, EAllowedDOFs inRHS)
Bitwise XOR assignment operator for EAllowedDOFs.
Definition: AllowedDOFs.h:62
constexpr EAllowedDOFs & operator|=(EAllowedDOFs &ioLHS, EAllowedDOFs inRHS)
Bitwise OR assignment operator for EAllowedDOFs.
Definition: AllowedDOFs.h:48
constexpr EAllowedDOFs operator&(EAllowedDOFs inLHS, EAllowedDOFs inRHS)
Bitwise AND operator for EAllowedDOFs.
Definition: AllowedDOFs.h:30
std::uint8_t uint8
Definition: Core.h:440
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361