mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
Get/Set FixedRotation in play mode
This commit is contained in:
@@ -353,7 +353,7 @@ namespace GlitchyEngine.World
|
||||
|
||||
public BodyType BodyType = .Static;
|
||||
|
||||
public bool FixedRotation = false;
|
||||
public bool _fixedRotation = false;
|
||||
|
||||
private int _runtimeBody = 0;
|
||||
|
||||
@@ -367,6 +367,20 @@ namespace GlitchyEngine.World
|
||||
[Inline]
|
||||
set mut => _runtimeBody = (int)(void*)value;
|
||||
}
|
||||
|
||||
public bool FixedRotation
|
||||
{
|
||||
get => _fixedRotation;
|
||||
set mut
|
||||
{
|
||||
_fixedRotation = value;
|
||||
|
||||
if (RuntimeBody != null)
|
||||
{
|
||||
Box2D.Body.SetFixedRotation(RuntimeBody, _fixedRotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*public float LinearDamping
|
||||
{
|
||||
|
||||
@@ -587,7 +587,9 @@ class SceneSerializer
|
||||
Deserialize.Value(reader, "BodyType", out component.BodyType);
|
||||
reader.EntryEnd();
|
||||
|
||||
Deserialize.Value(reader, "FixedRotation", out component.FixedRotation);
|
||||
bool fixedRotation = false;
|
||||
Deserialize.Value(reader, "FixedRotation", out fixedRotation);
|
||||
component.FixedRotation = fixedRotation;
|
||||
|
||||
return .Ok;
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user