Merge branch 'Tryibion-actor-CM'
This commit is contained in:
@@ -246,24 +246,53 @@ namespace FlaxEditor.Windows.Assets
|
||||
// Spawning actors options
|
||||
|
||||
contextMenu.AddSeparator();
|
||||
var spawnMenu = contextMenu.AddChildMenu("New");
|
||||
var newActorCm = spawnMenu.ContextMenu;
|
||||
for (int i = 0; i < SceneTreeWindow.SpawnActorsGroups.Length; i++)
|
||||
{
|
||||
var group = SceneTreeWindow.SpawnActorsGroups[i];
|
||||
|
||||
if (group.Types.Length == 1)
|
||||
// Go through each actor and add it to the context menu if it has the ActorContextMenu attribute
|
||||
foreach (var actorType in Editor.CodeEditing.Actors.Get())
|
||||
{
|
||||
if (actorType.IsAbstract)
|
||||
continue;
|
||||
ActorContextMenuAttribute attribute = null;
|
||||
foreach (var e in actorType.GetAttributes(true))
|
||||
{
|
||||
var type = group.Types[0].Value;
|
||||
newActorCm.AddButton(group.Types[0].Key, () => Spawn(type));
|
||||
}
|
||||
else
|
||||
{
|
||||
var groupCm = newActorCm.AddChildMenu(group.Name).ContextMenu;
|
||||
for (int j = 0; j < group.Types.Length; j++)
|
||||
if (e is ActorContextMenuAttribute actorContextMenuAttribute)
|
||||
{
|
||||
var type = group.Types[j].Value;
|
||||
groupCm.AddButton(group.Types[j].Key, () => Spawn(type));
|
||||
attribute = actorContextMenuAttribute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attribute == null)
|
||||
continue;
|
||||
var splitPath = attribute.Path.Split('/');
|
||||
ContextMenuChildMenu childCM = null;
|
||||
bool mainCM = true;
|
||||
for (int i = 0; i < splitPath?.Length; i++)
|
||||
{
|
||||
if (i == splitPath.Length - 1)
|
||||
{
|
||||
if (mainCM)
|
||||
{
|
||||
contextMenu.AddButton(splitPath[i].Trim(), () => Spawn(actorType.Type));
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM?.ContextMenu.AddButton(splitPath[i].Trim(), () => Spawn(actorType.Type));
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mainCM)
|
||||
{
|
||||
childCM = contextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM = childCM?.ContextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
}
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,23 +60,57 @@ namespace FlaxEditor.Windows
|
||||
if (isSingleActorSelected)
|
||||
{
|
||||
var convertMenu = contextMenu.AddChildMenu("Convert");
|
||||
var convertActorCm = convertMenu.ContextMenu;
|
||||
for (int i = 0; i < SpawnActorsGroups.Length; i++)
|
||||
convertMenu.ContextMenu.AutoSort = true;
|
||||
foreach (var actorType in Editor.CodeEditing.Actors.Get())
|
||||
{
|
||||
var group = SpawnActorsGroups[i];
|
||||
if (actorType.IsAbstract)
|
||||
continue;
|
||||
|
||||
if (group.Types.Length == 1)
|
||||
ActorContextMenuAttribute attribute = null;
|
||||
foreach (var e in actorType.GetAttributes(true))
|
||||
{
|
||||
var type = group.Types[0].Value;
|
||||
convertActorCm.AddButton(group.Types[0].Key, () => Editor.SceneEditing.Convert(type));
|
||||
}
|
||||
else
|
||||
{
|
||||
var groupCm = convertActorCm.AddChildMenu(group.Name).ContextMenu;
|
||||
for (int j = 0; j < group.Types.Length; j++)
|
||||
if (e is ActorContextMenuAttribute actorContextMenuAttribute)
|
||||
{
|
||||
var type = group.Types[j].Value;
|
||||
groupCm.AddButton(group.Types[j].Key, () => Editor.SceneEditing.Convert(type));
|
||||
attribute = actorContextMenuAttribute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attribute == null)
|
||||
continue;
|
||||
var splitPath = attribute?.Path.Split('/');
|
||||
ContextMenuChildMenu childCM = convertMenu;
|
||||
bool mainCM = true;
|
||||
for (int i = 0; i < splitPath?.Length; i++)
|
||||
{
|
||||
if (i == splitPath.Length - 1)
|
||||
{
|
||||
if (mainCM)
|
||||
{
|
||||
convertMenu.ContextMenu.AddButton(splitPath[i].Trim(), () => Editor.SceneEditing.Convert(actorType.Type));
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM?.ContextMenu.AddButton(splitPath[i].Trim(), () => Editor.SceneEditing.Convert(actorType.Type));
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove new path for converting menu
|
||||
if (splitPath[i] == "New")
|
||||
continue;
|
||||
|
||||
if (mainCM)
|
||||
{
|
||||
childCM = convertMenu.ContextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM = childCM?.ContextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
}
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,24 +148,50 @@ namespace FlaxEditor.Windows
|
||||
|
||||
contextMenu.AddSeparator();
|
||||
|
||||
var spawnMenu = contextMenu.AddChildMenu("New");
|
||||
var newActorCm = spawnMenu.ContextMenu;
|
||||
for (int i = 0; i < SpawnActorsGroups.Length; i++)
|
||||
// go through each actor and add it to the context menu if it has the ActorContextMenu attribute
|
||||
foreach (var actorType in Editor.CodeEditing.Actors.Get())
|
||||
{
|
||||
var group = SpawnActorsGroups[i];
|
||||
if (actorType.IsAbstract || !actorType.HasAttribute(typeof(ActorContextMenuAttribute), true))
|
||||
continue;
|
||||
|
||||
if (group.Types.Length == 1)
|
||||
ActorContextMenuAttribute attribute = null;
|
||||
foreach (var actorAttribute in actorType.GetAttributes(true))
|
||||
{
|
||||
var type = group.Types[0].Value;
|
||||
newActorCm.AddButton(group.Types[0].Key, () => Spawn(type));
|
||||
}
|
||||
else
|
||||
{
|
||||
var groupCm = newActorCm.AddChildMenu(group.Name).ContextMenu;
|
||||
for (int j = 0; j < group.Types.Length; j++)
|
||||
if (actorAttribute is ActorContextMenuAttribute actorContextMenuAttribute)
|
||||
{
|
||||
var type = group.Types[j].Value;
|
||||
groupCm.AddButton(group.Types[j].Key, () => Spawn(type));
|
||||
attribute = actorContextMenuAttribute;
|
||||
}
|
||||
}
|
||||
var splitPath = attribute?.Path.Split('/');
|
||||
ContextMenuChildMenu childCM = null;
|
||||
bool mainCM = true;
|
||||
for (int i = 0; i < splitPath?.Length; i++)
|
||||
{
|
||||
if (i == splitPath.Length - 1)
|
||||
{
|
||||
if (mainCM)
|
||||
{
|
||||
contextMenu.AddButton(splitPath[i].Trim(), () => Spawn(actorType.Type));
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM?.ContextMenu.AddButton(splitPath[i].Trim(), () => Spawn(actorType.Type));
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mainCM)
|
||||
{
|
||||
childCM = contextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
mainCM = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
childCM = childCM?.ContextMenu.GetOrAddChildMenu(splitPath[i].Trim());
|
||||
}
|
||||
childCM.ContextMenu.AutoSort = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,113 +22,6 @@ namespace FlaxEditor.Windows
|
||||
/// <seealso cref="FlaxEditor.Windows.SceneEditorWindow" />
|
||||
public partial class SceneTreeWindow : SceneEditorWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// The spawnable actors group.
|
||||
/// </summary>
|
||||
public struct ActorsGroup
|
||||
{
|
||||
/// <summary>
|
||||
/// The group name.
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// The types to spawn (name and type).
|
||||
/// </summary>
|
||||
public KeyValuePair<string, Type>[] Types;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Spawnable actors (groups with single entry are inlined without a child menu)
|
||||
/// </summary>
|
||||
public static readonly ActorsGroup[] SpawnActorsGroups =
|
||||
{
|
||||
new ActorsGroup
|
||||
{
|
||||
Types = new[] { new KeyValuePair<string, Type>("Actor", typeof(EmptyActor)) }
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Types = new[] { new KeyValuePair<string, Type>("Model", typeof(StaticModel)) }
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Types = new[] { new KeyValuePair<string, Type>("Camera", typeof(Camera)) }
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Name = "Lights",
|
||||
Types = new[]
|
||||
{
|
||||
new KeyValuePair<string, Type>("Directional Light", typeof(DirectionalLight)),
|
||||
new KeyValuePair<string, Type>("Point Light", typeof(PointLight)),
|
||||
new KeyValuePair<string, Type>("Spot Light", typeof(SpotLight)),
|
||||
new KeyValuePair<string, Type>("Sky Light", typeof(SkyLight)),
|
||||
}
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Name = "Visuals",
|
||||
Types = new[]
|
||||
{
|
||||
new KeyValuePair<string, Type>("Environment Probe", typeof(EnvironmentProbe)),
|
||||
new KeyValuePair<string, Type>("Sky", typeof(Sky)),
|
||||
new KeyValuePair<string, Type>("Skybox", typeof(Skybox)),
|
||||
new KeyValuePair<string, Type>("Exponential Height Fog", typeof(ExponentialHeightFog)),
|
||||
new KeyValuePair<string, Type>("PostFx Volume", typeof(PostFxVolume)),
|
||||
new KeyValuePair<string, Type>("Decal", typeof(Decal)),
|
||||
new KeyValuePair<string, Type>("Particle Effect", typeof(ParticleEffect)),
|
||||
}
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Name = "Physics",
|
||||
Types = new[]
|
||||
{
|
||||
new KeyValuePair<string, Type>("Rigid Body", typeof(RigidBody)),
|
||||
new KeyValuePair<string, Type>("Character Controller", typeof(CharacterController)),
|
||||
new KeyValuePair<string, Type>("Box Collider", typeof(BoxCollider)),
|
||||
new KeyValuePair<string, Type>("Sphere Collider", typeof(SphereCollider)),
|
||||
new KeyValuePair<string, Type>("Capsule Collider", typeof(CapsuleCollider)),
|
||||
new KeyValuePair<string, Type>("Mesh Collider", typeof(MeshCollider)),
|
||||
new KeyValuePair<string, Type>("Fixed Joint", typeof(FixedJoint)),
|
||||
new KeyValuePair<string, Type>("Distance Joint", typeof(DistanceJoint)),
|
||||
new KeyValuePair<string, Type>("Slider Joint", typeof(SliderJoint)),
|
||||
new KeyValuePair<string, Type>("Spherical Joint", typeof(SphericalJoint)),
|
||||
new KeyValuePair<string, Type>("Hinge Joint", typeof(HingeJoint)),
|
||||
new KeyValuePair<string, Type>("D6 Joint", typeof(D6Joint)),
|
||||
}
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Name = "Other",
|
||||
Types = new[]
|
||||
{
|
||||
new KeyValuePair<string, Type>("Animated Model", typeof(AnimatedModel)),
|
||||
new KeyValuePair<string, Type>("Bone Socket", typeof(BoneSocket)),
|
||||
new KeyValuePair<string, Type>("CSG Box Brush", typeof(BoxBrush)),
|
||||
new KeyValuePair<string, Type>("Audio Source", typeof(AudioSource)),
|
||||
new KeyValuePair<string, Type>("Audio Listener", typeof(AudioListener)),
|
||||
new KeyValuePair<string, Type>("Scene Animation", typeof(SceneAnimationPlayer)),
|
||||
new KeyValuePair<string, Type>("Nav Mesh Bounds Volume", typeof(NavMeshBoundsVolume)),
|
||||
new KeyValuePair<string, Type>("Nav Link", typeof(NavLink)),
|
||||
new KeyValuePair<string, Type>("Nav Modifier Volume", typeof(NavModifierVolume)),
|
||||
new KeyValuePair<string, Type>("Spline", typeof(Spline)),
|
||||
}
|
||||
},
|
||||
new ActorsGroup
|
||||
{
|
||||
Name = "GUI",
|
||||
Types = new[]
|
||||
{
|
||||
new KeyValuePair<string, Type>("UI Control", typeof(UIControl)),
|
||||
new KeyValuePair<string, Type>("UI Canvas", typeof(UICanvas)),
|
||||
new KeyValuePair<string, Type>("Text Render", typeof(TextRender)),
|
||||
new KeyValuePair<string, Type>("Sprite Render", typeof(SpriteRender)),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
private TextBox _searchBox;
|
||||
private Tree _tree;
|
||||
private Panel _sceneTreePanel;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// The scene animation playback actor.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Other/Scene Animation\")") class FLAXENGINE_API SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SceneAnimationPlayer);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Represents a listener that hears audio sources. For spatial audio the volume and pitch of played audio is determined by the distance, orientation and velocity differences between the source and the listener.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API AudioListener : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Listener\")") class FLAXENGINE_API AudioListener : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AudioListener);
|
||||
private:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/// <remarks>
|
||||
/// Whether or not an audio source is spatial is controlled by the assigned AudioClip.The volume and the pitch of a spatial audio source is controlled by its position and the AudioListener's position/direction/velocity.
|
||||
/// </remarks>
|
||||
API_CLASS() class FLAXENGINE_API AudioSource : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Source\")") class FLAXENGINE_API AudioSource : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AudioSource);
|
||||
friend class AudioStreamingHandler;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/// <summary>
|
||||
/// Performs an animation and renders a skinned model.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Animated Model\")") class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AnimatedModel);
|
||||
friend class AnimationsSystem;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Actor that links to the animated model skeleton node transformation.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API BoneSocket : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Bone Socket\")") class FLAXENGINE_API BoneSocket : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoneSocket);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
/// <summary>
|
||||
/// Performs CSG box brush operation that adds or removes geometry.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Box Brush\")") class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoxBrush);
|
||||
private:
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/// <summary>
|
||||
/// Describes the camera projection and view. Provides information about how to render scene (viewport location and direction, etc.).
|
||||
/// </summary>
|
||||
API_CLASS(Sealed) class FLAXENGINE_API Camera : public Actor
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/Camera\")") class FLAXENGINE_API Camera : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Camera);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// Actor that draws the can be used to draw a custom decals on top of the other objects.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API Decal : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Decal\")") class FLAXENGINE_API Decal : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Decal);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Directional light emits light from direction in space.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API DirectionalLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Directional Light\")") class FLAXENGINE_API DirectionalLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(DirectionalLight);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// The empty actor that is useful to create hierarchy and/or hold scripts. See <see cref="Script"/>.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API EmptyActor : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Actor\")") class FLAXENGINE_API EmptyActor : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(EmptyActor);
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Environment Probe can capture space around the objects to provide reflections.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API EnvironmentProbe : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Environment Probe\")") class FLAXENGINE_API EnvironmentProbe : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(EnvironmentProbe);
|
||||
public:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/// <summary>
|
||||
/// Used to create fogging effects such as clouds but with a density that is related to the height of the fog.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API ExponentialHeightFog : public Actor, public IFogRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Exponential Height Fog\")") class FLAXENGINE_API ExponentialHeightFog : public Actor, public IFogRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(ExponentialHeightFog);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Point light emits light from point in all directions.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API PointLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Point Light\")") class FLAXENGINE_API PointLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(PointLight);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that blends custom set of post process settings into the rendering.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Post Fx Volume\")") class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(PostFxVolume);
|
||||
private:
|
||||
|
||||
@@ -14,7 +14,7 @@ class GPUPipelineState;
|
||||
/// <summary>
|
||||
/// Sky actor renders atmosphere around the scene with fog and sky.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API Sky : public Actor, public IAtmosphericFogRenderer, public ISkyRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky\")") class FLAXENGINE_API Sky : public Actor, public IAtmosphericFogRenderer, public ISkyRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Sky);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Sky light captures the distant parts of the scene and applies it as a light. Allows to add ambient light.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API SkyLight : public Light
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Sky Light\")") class FLAXENGINE_API SkyLight : public Light
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SkyLight);
|
||||
public:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// Skybox actor renders sky using custom cube texture or material.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API Skybox : public Actor, public ISkyRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky Box\")") class FLAXENGINE_API Skybox : public Actor, public ISkyRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Skybox);
|
||||
private:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// Spline shape actor that defines spatial curve with utility functions for general purpose usage.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API Spline : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Spline\")") class FLAXENGINE_API Spline : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Spline);
|
||||
typedef BezierCurveKeyframe<Transform> Keyframe;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Spot light emits light from the point in a given direction.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API SpotLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Spot Light\")") class FLAXENGINE_API SpotLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SpotLight);
|
||||
private:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Renders model on the screen.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API StaticModel : public ModelInstanceActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Model\")") class FLAXENGINE_API StaticModel : public ModelInstanceActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(StaticModel);
|
||||
private:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// The off-mesh link objects used to define a custom point-to-point edge within the navigation graph.
|
||||
/// An off-mesh connection is a user defined traversable connection made up to two vertices, at least one of which resides within a navigation mesh polygon allowing movement outside the navigation mesh.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API NavLink : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Link\")") class FLAXENGINE_API NavLink : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavLink);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that defines the area of the scene in which navigation meshes are generated.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API NavMeshBoundsVolume : public BoxVolume
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Mesh Bounds Volume\")") class FLAXENGINE_API NavMeshBoundsVolume : public BoxVolume
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavMeshBoundsVolume);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that defines the area of the scene in which navigation is restricted (eg. higher traversal cost or dynamic obstacle block).
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API NavModifierVolume : public BoxVolume
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Modifier Volume\")") class FLAXENGINE_API NavModifierVolume : public BoxVolume
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavModifierVolume);
|
||||
public:
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
/// <summary>
|
||||
/// The particle system instance that plays the particles simulation in the game.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API ParticleEffect : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Particle Effects\")") class FLAXENGINE_API ParticleEffect : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(ParticleEffect);
|
||||
public:
|
||||
|
||||
@@ -14,7 +14,7 @@ class Collider;
|
||||
/// Physics simulation driven object.
|
||||
/// </summary>
|
||||
/// <seealso cref="Actor" />
|
||||
API_CLASS() class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Rigid Body\")") class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(RigidBody);
|
||||
protected:
|
||||
@@ -79,9 +79,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the 'drag' force added to reduce linear movement.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Linear damping can be used to slow down an object. The higher the drag the more the object slows down.
|
||||
/// </remarks>
|
||||
/// <remarks>Linear damping can be used to slow down an object. The higher the drag the more the object slows down.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(60), DefaultValue(0.01f), Limit(0), EditorDisplay(\"Rigid Body\")")
|
||||
FORCE_INLINE float GetLinearDamping() const
|
||||
{
|
||||
@@ -91,18 +89,14 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the 'drag' force added to reduce linear movement.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Linear damping can be used to slow down an object. The higher the drag the more the object slows down.
|
||||
/// </remarks>
|
||||
/// <remarks>Linear damping can be used to slow down an object. The higher the drag the more the object slows down.</remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetLinearDamping(float value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the 'drag' force added to reduce angular movement.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.
|
||||
/// </remarks>
|
||||
/// <remarks>Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(70), DefaultValue(0.05f), Limit(0), EditorDisplay(\"Rigid Body\")")
|
||||
FORCE_INLINE float GetAngularDamping() const
|
||||
{
|
||||
@@ -112,9 +106,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the 'drag' force added to reduce angular movement.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.
|
||||
/// </remarks>
|
||||
/// <remarks>Angular damping can be used to slow down the rotation of an object. The higher the drag the more the rotation slows down.</remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetAngularDamping(float value);
|
||||
|
||||
@@ -287,46 +279,35 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the linear velocity of the rigidbody.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour.
|
||||
/// </remarks>
|
||||
/// <remarks>It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour. </remarks>
|
||||
API_PROPERTY(Attributes="HideInEditor")
|
||||
Vector3 GetLinearVelocity() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the linear velocity of the rigidbody.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour.
|
||||
/// </remarks>
|
||||
/// <remarks>It's used mostly to get the current velocity. Manual modifications may result in unrealistic behaviour. </remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetLinearVelocity(const Vector3& value) const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the angular velocity of the rigidbody measured in radians per second.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour.
|
||||
/// </remarks>
|
||||
/// <remarks>It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour. </remarks>
|
||||
API_PROPERTY(Attributes="HideInEditor")
|
||||
Vector3 GetAngularVelocity() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the angular velocity of the rigidbody measured in radians per second.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour.
|
||||
/// </remarks>
|
||||
/// <remarks>It's used mostly to get the current angular velocity. Manual modifications may result in unrealistic behaviour.</remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetAngularVelocity(const Vector3& value) const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum depenetration velocity when rigidbody moving out of penetrating state.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value controls how much velocity the solver can introduce to correct for penetrations in contacts.
|
||||
/// Using this property can smooth objects moving out of colliding state and prevent unstable motion.
|
||||
/// </remarks>
|
||||
/// <remarks>This value controls how much velocity the solver can introduce to correct for penetrations in contacts. Using this property can smooth objects moving out of colliding state and prevent unstable motion.</remarks>
|
||||
/// <returns>The value</returns>
|
||||
API_PROPERTY(Attributes="HideInEditor")
|
||||
float GetMaxDepenetrationVelocity() const;
|
||||
@@ -334,19 +315,14 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the maximum depenetration velocity when rigidbody moving out of penetrating state.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value controls how much velocity the solver can introduce to correct for penetrations in contacts.
|
||||
/// Using this property can smooth objects moving out of colliding state and prevent unstable motion.
|
||||
/// </remarks>
|
||||
/// <remarks>This value controls how much velocity the solver can introduce to correct for penetrations in contacts. Using this property can smooth objects moving out of colliding state and prevent unstable motion.</remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetMaxDepenetrationVelocity(const float value) const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mass-normalized kinetic energy threshold below which an actor may go to sleep.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.
|
||||
/// </remarks>
|
||||
/// <remarks>Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.</remarks>
|
||||
/// <returns>The value</returns>
|
||||
API_PROPERTY(Attributes="HideInEditor")
|
||||
float GetSleepThreshold() const;
|
||||
@@ -354,9 +330,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the mass-normalized kinetic energy threshold below which an actor may go to sleep.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.
|
||||
/// </remarks>
|
||||
/// <remarks>Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.</remarks>
|
||||
/// <param name="value">The value.</param>
|
||||
API_PROPERTY() void SetSleepThreshold(const float value) const;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// A box-shaped primitive collider.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API BoxCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Box Collider\")") class FLAXENGINE_API BoxCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoxCollider);
|
||||
private:
|
||||
@@ -20,9 +20,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the size of the box, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The box size will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The box size will be scaled by the actor's world scale. </remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(typeof(Vector3), \"100,100,100\"), EditorDisplay(\"Collider\")")
|
||||
FORCE_INLINE Float3 GetSize() const
|
||||
{
|
||||
@@ -32,9 +30,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the size of the box, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The box size will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The box size will be scaled by the actor's world scale. </remarks>
|
||||
API_PROPERTY() void SetSize(const Float3& value);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
/// <summary>
|
||||
/// A capsule-shaped primitive collider.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Capsules are cylinders with a half-sphere at each end centered at the origin and extending along the X axis, and two hemispherical ends.
|
||||
/// </remarks>
|
||||
/// <remarks>Capsules are cylinders with a half-sphere at each end centered at the origin and extending along the X axis, and two hemispherical ends.</remarks>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API CapsuleCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Capsule Collider\")") class FLAXENGINE_API CapsuleCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CapsuleCollider);
|
||||
private:
|
||||
@@ -24,9 +22,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The sphere radius will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The sphere radius will be scaled by the actor's world scale.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(20.0f), EditorDisplay(\"Collider\")")
|
||||
FORCE_INLINE float GetRadius() const
|
||||
{
|
||||
@@ -36,17 +32,13 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The sphere radius will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The sphere radius will be scaled by the actor's world scale. </remarks>
|
||||
API_PROPERTY() void SetRadius(float value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the height of the capsule, measured in the object's local space between the centers of the hemispherical ends.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The capsule height will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The capsule height will be scaled by the actor's world scale.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(100.0f), EditorDisplay(\"Collider\")")
|
||||
FORCE_INLINE float GetHeight() const
|
||||
{
|
||||
@@ -56,9 +48,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the height of the capsule, measured in the object's local space between the centers of the hemispherical ends.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The capsule height will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The capsule height will be scaled by the actor's world scale.</remarks>
|
||||
API_PROPERTY() void SetHeight(float value);
|
||||
|
||||
public:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// Physical objects that allows to easily do player movement constrained by collisions without having to deal with a rigidbody.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Character Controller\")") class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CharacterController);
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// A collider represented by an arbitrary mesh.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API MeshCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Mesh Collider\")") class FLAXENGINE_API MeshCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(MeshCollider);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// A sphere-shaped primitive collider.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API SphereCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Sphere Collider\")") class FLAXENGINE_API SphereCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SphereCollider);
|
||||
private:
|
||||
@@ -18,9 +18,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The sphere radius will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The sphere radius will be scaled by the actor's world scale.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(50.0f), EditorDisplay(\"Collider\")")
|
||||
FORCE_INLINE float GetRadius() const
|
||||
{
|
||||
@@ -30,9 +28,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The sphere radius will be scaled by the actor's world scale.
|
||||
/// </remarks>
|
||||
/// <remarks>The sphere radius will be scaled by the actor's world scale.</remarks>
|
||||
API_PROPERTY() void SetRadius(float value);
|
||||
|
||||
public:
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
/// It also allows you to constrain limits to only specific axes or completely lock specific axes.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API D6Joint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/D6 Joint\")") class FLAXENGINE_API D6Joint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(D6Joint);
|
||||
private:
|
||||
@@ -174,9 +174,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the motion type around the specified axis.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.
|
||||
/// </remarks>
|
||||
/// <remarks>Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.</remarks>
|
||||
/// <param name="axis">The axis the degree of freedom around which the motion type is specified.</param>
|
||||
/// <returns>The value.</returns>
|
||||
API_FUNCTION() FORCE_INLINE D6JointMotion GetMotion(const D6JointAxis axis) const
|
||||
@@ -187,9 +185,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the motion type around the specified axis.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.
|
||||
/// </remarks>
|
||||
/// <remarks>Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.</remarks>
|
||||
/// <param name="axis">The axis the degree of freedom around which the motion type is specified.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
API_FUNCTION() void SetMotion(const D6JointAxis axis, const D6JointMotion value);
|
||||
|
||||
@@ -37,7 +37,7 @@ DECLARE_ENUM_OPERATORS(DistanceJointFlag);
|
||||
/// Physics joint that maintains an upper or lower (or both) bound on the distance between two bodies.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API DistanceJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Distance Joint\")") class FLAXENGINE_API DistanceJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(DistanceJoint);
|
||||
private:
|
||||
@@ -65,9 +65,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the allowed minimum distance for the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used only when DistanceJointFlag.MinDistance flag is set. The minimum distance must be no more than the maximum distance. Default: 0, Range: [0, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>Used only when DistanceJointFlag.MinDistance flag is set. The minimum distance must be no more than the maximum distance. Default: 0, Range: [0, float.MaxValue].</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(0.0f), Limit(0.0f), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE float GetMinDistance() const
|
||||
{
|
||||
@@ -77,17 +75,13 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the allowed minimum distance for the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used only when DistanceJointFlag.MinDistance flag is set. The minimum distance must be no more than the maximum distance. Default: 0, Range: [0, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>Used only when DistanceJointFlag.MinDistance flag is set. The minimum distance must be no more than the maximum distance. Default: 0, Range: [0, float.MaxValue].</remarks>
|
||||
API_PROPERTY() void SetMinDistance(float value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the allowed maximum distance for the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used only when DistanceJointFlag.MaxDistance flag is set. The maximum distance must be no less than the minimum distance. Default: 0, Range: [0, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>Used only when DistanceJointFlag.MaxDistance flag is set. The maximum distance must be no less than the minimum distance. Default: 0, Range: [0, float.MaxValue].</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(120), DefaultValue(10.0f), Limit(0.0f), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE float GetMaxDistance() const
|
||||
{
|
||||
@@ -97,17 +91,13 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the allowed maximum distance for the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used only when DistanceJointFlag.MaxDistance flag is set. The maximum distance must be no less than the minimum distance. Default: 0, Range: [0, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>Used only when DistanceJointFlag.MaxDistance flag is set. The maximum distance must be no less than the minimum distance. Default: 0, Range: [0, float.MaxValue].</remarks>
|
||||
API_PROPERTY() void SetMaxDistance(float value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the error tolerance of the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The distance beyond the joint's [min, max] range before the joint becomes active. Default: 25, Range: [0.1, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>The distance beyond the joint's [min, max] range before the joint becomes active. Default: 25, Range: [0.1, float.MaxValue].</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(130), DefaultValue(25.0f), Limit(0.0f), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE float GetTolerance() const
|
||||
{
|
||||
@@ -117,9 +107,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the error tolerance of the joint.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The distance beyond the joint's [min, max] range before the joint becomes active. Default: 25, Range: [0.1, float.MaxValue].
|
||||
/// </remarks>
|
||||
/// <remarks>The distance beyond the joint's [min, max] range before the joint becomes active. Default: 25, Range: [0.1, float.MaxValue]. </remarks>
|
||||
API_PROPERTY() void SetTolerance(float value);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// Physics joint that maintains a fixed distance and orientation between its two attached bodies.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API FixedJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Fixed Joint\")") class FLAXENGINE_API FixedJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(FixedJoint);
|
||||
public:
|
||||
|
||||
@@ -57,17 +57,9 @@ API_STRUCT() struct HingeJointDrive
|
||||
API_FIELD() bool FreeSpin = false;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Compares two objects.
|
||||
/// </summary>
|
||||
/// <param name="other">The other.</param>
|
||||
/// <returns>True if both objects are equal.</returns>
|
||||
bool operator==(const HingeJointDrive& other) const
|
||||
{
|
||||
return Velocity == other.Velocity
|
||||
&& ForceLimit == other.ForceLimit
|
||||
&& GearRatio == other.GearRatio
|
||||
&& FreeSpin && other.FreeSpin;
|
||||
return Math::NearEqual(Velocity, other.Velocity) && Math::NearEqual(ForceLimit, other.ForceLimit) && Math::NearEqual(GearRatio, other.GearRatio) && FreeSpin == other.FreeSpin;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,7 +67,7 @@ public:
|
||||
/// Physics joint that removes all but a single rotation degree of freedom from its two attached bodies (for example a door hinge).
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API HingeJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Hinge Joint\")") class FLAXENGINE_API HingeJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(HingeJoint);
|
||||
private:
|
||||
@@ -101,9 +93,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(110), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE LimitAngularRange GetLimit() const
|
||||
{
|
||||
@@ -113,17 +103,13 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY() void SetLimit(const LimitAngularRange& value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the joint drive properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You must enable the drive flag on the joint in order for the drive to be active.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You must enable the drive flag on the joint in order for the drive to be active.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(120), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE HingeJointDrive GetDrive() const
|
||||
{
|
||||
@@ -133,9 +119,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the joint drive properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You must enable the drive flag on the joint in order for the drive to be active.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You must enable the drive flag on the joint in order for the drive to be active.</remarks>
|
||||
API_PROPERTY() void SetDrive(const HingeJointDrive& value);
|
||||
|
||||
public:
|
||||
|
||||
@@ -27,7 +27,7 @@ DECLARE_ENUM_OPERATORS(SliderJointFlag);
|
||||
/// Physics joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API SliderJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Slider Joint\")") class FLAXENGINE_API SliderJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SliderJoint);
|
||||
private:
|
||||
@@ -52,9 +52,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(110), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE LimitLinearRange GetLimit() const
|
||||
{
|
||||
@@ -64,9 +62,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY() void SetLimit(const LimitLinearRange& value);
|
||||
|
||||
public:
|
||||
|
||||
@@ -29,7 +29,7 @@ DECLARE_ENUM_OPERATORS(SphericalJointFlag);
|
||||
/// rotate around the anchor points, and their rotation can be limited by an elliptical cone.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS() class FLAXENGINE_API SphericalJoint : public Joint
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Physics/Spherical Joint\")") class FLAXENGINE_API SphericalJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SphericalJoint);
|
||||
private:
|
||||
@@ -54,9 +54,7 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY(Attributes="EditorOrder(110), EditorDisplay(\"Joint\")")
|
||||
FORCE_INLINE LimitConeRange GetLimit() const
|
||||
{
|
||||
@@ -66,9 +64,7 @@ public:
|
||||
/// <summary>
|
||||
/// Sets the joint limit properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Determines a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must enable the limit flag on the joint in order for this to be recognized.
|
||||
/// </remarks>
|
||||
/// <remarks>Determines a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must enable the limit flag on the joint in order for this to be recognized.</remarks>
|
||||
API_PROPERTY() void SetLimit(const LimitConeRange& value);
|
||||
|
||||
public:
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace FlaxEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to show actors that can be created in the scene and prefab context menus. Separate the subcontext menus with a /.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ActorContextMenuAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The path to be used in the context menu
|
||||
/// </summary>
|
||||
public string Path;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActorContextMenuAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="path">The path to use to create the context menu</param>
|
||||
public ActorContextMenuAttribute(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Sprite rendering object.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API SpriteRender : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Sprite Render\")") class FLAXENGINE_API SpriteRender : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SpriteRender);
|
||||
private:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/// <summary>
|
||||
/// Text rendering object.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API TextRender : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Text Render\")") class FLAXENGINE_API TextRender : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(TextRender);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Root of the UI structure. Renders GUI and handles input events forwarding.
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, NoConstructor) class FLAXENGINE_API UICanvas : public Actor
|
||||
API_CLASS(Sealed, NoConstructor, Attributes="ActorContextMenu(\"New/UI/UI Canvas\")") class FLAXENGINE_API UICanvas : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(UICanvas);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// Contains a single GUI control (on C# side).
|
||||
/// </summary>
|
||||
API_CLASS(Sealed) class FLAXENGINE_API UIControl : public Actor
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/UI/UI Control\")") class FLAXENGINE_API UIControl : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(UIControl);
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user