sim3d.Actor
Description
Use the sim3d.Actor
object to create an empty actor object in
the 3D environment without any visual meshes. After you create a
sim3d.Actor
object you can modify aspects of the actor object by setting
property values.
Import 3D files to build an appearance for the actor object.
Define actor appearance using 3D graphic primitive shapes or mesh data.
Create hierarchical structure through defining parent-child relationships.
Support 3D transformations in different coordinate systems.
Enable physics simulation of the Unreal Engine®.
Enable object interaction events, such as hit event, overlap event, and click event.
Creation
Description
creates a default
empty actor object in the 3D environment without visual meshes.actor
= sim3d.Actor()
specifies options using one or more optional name-value arguments. For example, to create
an actor at the position [3 4 3], set actor
= sim3d.Actor(Name=Value
)Translation
to [3 4
3]
.
Input Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: actor = sim3d.Actor(ActorName='Actor',Translation=[3 4
3],Mobility=sim3d.utils.MobilityTypes.Movable,OnHit=@hitcallback)
creates a
movable empty actor object with the specified name, position, and custom callback function
handle for hit event.
ActorName
— Name of actor
autogenerated name (default) | character array | string
Name of actor, specified as a character array or string. If you do not specify an actor name,
then the software assigns the actor an autogenerated name. Use
this argument to set the name of the
sim3d.Actor
object.
Note
If you specify the same name as an actor that already exists, then the software appends actor name you specify with a unique identifier.
Translation
— Relative translation
[0 0 0]
(default) | real 1-by-3 vector
Relative translation
(x,y,z) of the actor object to its
parent actor, specified as a real 1-by-3 vector, in m. Use Translation
to
change the position of the sim3d.Actor
object in the 3D environment along the
X, Y, and Z axes of the
coordinate system. When you add an actor to the 3D environment, the default parent actor is the
Scene Origin
at (0,0,0)
.
Example: Translation=[3 4 3]
Data Types: double
Rotation
— Relative rotation
[0 0 0]
(default) | real 1-by-3 vector
Relative rotation (roll,
pitch, yaw) of the actor object to its parent actor,
specified as a real 1-by-3 vector, in rad. Use Rotation
to rotate the
sim3d.Actor
object in the 3D environment.
Example: Rotation=[0 pi/2 pi/4]
Data Types: double
Scale
— Relative scale
[1 1 1]
(default) | real 1-by-3 vector
Relative scale in x, y
and z coordinates of the actor object to its parent actor, specified as a
real 1-by-3 vector. Use Scale
to resize the sim3d.Actor
object in the 3D environment along the X, Y, and
Z axes.
Example: Scale=[2 2 2]
Data Types: double
Mobility
— Type of actor mobility
'sim3d.utils.MobilityTypes.Static'
(default) | 'sim3d.utils.MobilityTypes.Movable'
Type of actor mobility to respond to physics, move the actor
during simulation, or both, specified as 'sim3d.utils.MobilityTypes.Movable'
or 'sim3d.utils.MobilityTypes.Static'
.
Example: Mobility=sim3d.utils.MobilityTypes.Movable
Data Types: sim3d.utils.MobilityTypes
ActorClassId
— Semantic segmentation map of object class identifiers
0
(default) | real positive scalar
Semantic segmentation map of object class identifiers, specified as real positive scalar. For a complete list of actor IDs and their corresponding object descriptions, see Labels.
OnHit
— Custom hit event callback function handle
handle to user-defined function
Custom hit event callback function handle, specified as the handle to the
user-defined function such as @hitcallback
. Use the function to
pass the actor handle as the input argument to access sim3d.Actor
properties during hit event.
Example: Onhit=@hitcallback
OnBeginOverlap
— Custom begin overlap event callback function handle
handle to user-defined function
Custom begin overlap event callback function handle, specified as the handle to
the user-defined function such as @beginoverlapcallback
. Use
the function to pass the actor handle as the input argument to access
sim3d.Actor
properties during begin overlap event.
Example: OnBeginOverlap=@beginoverlapcallback
OnEndOverlap
— Custom end overlap event callback function handle
handle to user-defined function
Custom end overlap event callback function handle, specified as the handle to
the user-defined function such as @endoverlapcallback
. Use the
function to pass the actor handle as the input argument to access
sim3d.Actor
properties during end overlap event.
Example: OnEndOverlap=@endoverlapcallback
OnClick
— Custom click event callback function handle
handle to user-defined function
Custom click event callback function handle, specified as the handle to the
user-defined function such as @clickcallback
. Use the function
to pass the actor handle as the input argument to access sim3d.Actor
properties during click event.
Example: OnClick=@clickcallback
Output Arguments
actor
— Actor object
sim3d.Actor
object
Actor object, returned as a sim3d.Actor
object. A unique
identifier and unique name is assigned to the actor. You can change the actor name,
but the unique identifier is associated with the actor until the actor is deleted. The
3D environment is composed of a hierarchical structure of actors.
Properties
Base Attributes
UserData
— Structure to hold actor data
structure
Structure to hold actor data, specified as a structure. You can update and maintain this data and use it to update the fields of the structure during simulation or in the setup method.
Parent
— Parent of actor
handle to parent actor object
Parent of actor, specified as a handle to the parent actor object. After you add an actor to
the sim3d.World
object, the default parent actor is the
Scene Origin
at (0,0,0)
. Use this property to
set any actor in the 3D environment as the parent actor of a
sim3d.Actor
object.
Children
— Children of actor
structure
This property is read-only.
Children of actor, specified as a structure. Each field of the structure contains a handle to
the child of a sim3d.Actor
object.
ParentWorld
— Parent world
handle to parent world object
Parent world, specified as a handle to the parent sim3d.World
object. You can use this property only if the sim3d.Actor
object is
added to the parent sim3d.World
object.
CoordinateSystem
— Actor orientation
'Default'
(default) | 'MATLAB'
| 'ISO8855'
| 'AERO'
| 'VRML'
| 'SAE'
Actor orientation representation in the 3D environment, specified as one of the listed values. The values are not case-sensitive.
'Default'
– World coordinate system'MATLAB'
– MATLAB® coordinate system'ISO8855'
– ISO 8855 standard coordinate system'AERO'
– SAE coordinate system'VRML'
– X3D ISO standard coordinate system'SAE'
– SAE coordinate system
To display the actor transformation in the specified coordinate system,
set this property first, and then set the transform properties
Translation
, Rotation
, and
Scale
. For more details on the different coordinate systems, see
Coordinate Systems in Simulink 3D Animation.
Data Types: string
Translation
— Relative translation
[0 0 0]
(default) | real 1-by-3 vector
Relative translation
(x,y,z) of the actor object to its
parent actor, specified as a real 1-by-3 vector, in m. Use Translation
to
change the position of the sim3d.Actor
object in the 3D environment along the
X, Y, and Z axes of the
coordinate system. When you add an actor to the 3D environment, the default parent actor is the
Scene Origin
at (0,0,0)
.
Example: actor.Translation = [1 2 1]
Rotation
— Relative rotation
[0 0 0]
(default) | real 1-by-3 vector
Relative rotation (roll,
pitch, yaw) of the actor object to its parent actor,
specified as a real 1-by-3 vector, in rad. Use Rotation
to rotate the
sim3d.Actor
object in the 3D environment.
Example: actor.Rotation = [pi/4 pi/8 pi/2]
Scale
— Relative scale
[1 1 1]
(default) | real 1-by-3 vector
Relative scale in x, y
and z coordinates of the actor object to its parent actor, specified as a
real 1-by-3 vector. Use Scale
to resize the sim3d.Actor
object in the 3D environment along the X, Y, and
Z axes.
Example: actor.Scale = [1 2 1]
Mobility
— Type of actor mobility
'sim3d.utils.MobilityTypes.Static'
(default) | 'sim3d.utils.MobilityTypes.Movable'
Type of actor mobility to respond to physics, move the actor
during simulation, or both, specified as 'sim3d.utils.MobilityTypes.Movable'
or 'sim3d.utils.MobilityTypes.Static'
.
Example: actor.Mobility =
sim3d.utils.MobilityTypes.Movable
Data Types: sim3d.utils.MobilityTypes
Mesh Attributes
Vertices
— Vertices of mesh geometry
empty array (default) | N-by-3 matrix
Vertices of mesh geometry, specified as an N-by-3 matrix. This matrix includes the coordinates of all vertex positions to be used for the mesh geometry. Each vertex has a vertex ID equal to its row number in the matrix. N specifies the number of vertices.
Example: actor.Vertices = [-1 -1 0; 1 -1 0; 1 1 0; -1 1 0; -1 -1 0; 1 -1
0;1 1 0;-1 1 0]
Data Types: double
Faces
— Vertices of each triangular face
empty array (default) | M-by-3 matrix
Vertices of each triangular face, specified as an M-by-3 matrix. This matrix defines how each triangle of the mesh is drawn. The matrix specifies the vertex IDs that define each triangular face of the mesh. M is the number of triangular faces in the mesh.
Example: actor.Faces = [0 3 2; 0 2 1; 4 6 7; 4 5
6]
Data Types: double
Normals
— Normal vectors of each vertex
empty array (default) | N-by-3 matrix
Normal vectors of each vertex, specified as an N-by-3 matrix.
Each row of the matrix specifies the normal vector for a vertex. This matrix must be
the same size as Vertices
.
Example: actor.Normals = [0 0 1; 0 0 1; 0 0 1; 0 0 1; 0 0 -1; 0 0 -1; 0 0
-1; 0 0 -1]
Data Types: double
TextureCoordinates
— Texture coordinates
empty array (default) | N-by-2 matrix
Texture coordinates for each vertex, specified as an N-by-2
matrix. This matrix defines which point on the texture file maps to each vertices.
This argument is optional and, if specified, must be the same length as
Vertices
.
Example: actor.TextureCoordinates = [0 0; 0 1; 1 1; 1 0; 0 0; 0 1; 1 1; 1
0]
VertexColors
— Vertex colors
empty array (default) | N-by-3 matrix
Vertex colors, specified as an N-by-3 matrix. This matrix
specifies the color value of each vertex in [R G B]
form. This
matrix must be the same length as Vertices
.
Note
To display VertexColors
along with the actor base color,
set the VertexBlend
property to a value greater than 0. If
VertexBlend
is 1, then actor displays only the
VertexColors
.
Example: actor.VertexColors = [1 0 0; 0 1 0; 0 0 1; 1 0 1; 1 1 0; 0 1 1; 1
1 0; 0 1 0]
Material Attributes
Color
— Base color of actor
[1 1 1]
(default) | real 1-by-3 vector
Base color of actor, specified as a real 1-by-3 vector. Color
consists of a vector of color RGB components [red green blue]
.
Values greater than 1
cause glowing and can be used for various
indicators. If the sim3d.Actor
object has a texture, the TextureMapping.Blend
coefficient can be
used to control how it blends with the base color.
Example: actor.Color = [0.3 0.27 0.9]
Transparency
— Transparency of actor
0
(default) | real positive number in the range (0,1)
Transparency of actor, specified as a real positive number in the range (0,1), where 0 indicates an opaque object and 1 indicates a completely transparent object.
Example: actor.Transparency = 0.8
Data Types: double
Shininess
— Shininess of actor
0.7
(default) | real positive number in the range (0,1)
Shininess of actor, specified as a real positive number in the range (0,1), where 0 indicates a nonshiny object and 1 indicates a completely shiny object.
Example: actor.Shininess = 0.3
Data Types: double
Metallic
— Metallic look of actor
0.7
(default) | real positive number in the range (0,1)
Metallic look of actor, specified as a real positive number in the range (0,1), where 0 indicates a plastic surface and 1 indicates a metallic surface.
Example: actor.Metallic = 0.1
Data Types: double
Flat
— Flat shading factor of actor
0
(default) | real positive number in the range (0,1)
Flat shading factor of actor, specified as a real positive number in the range (0,1), where 0 indicates a smooth shading and 1 indicates a faceted shading. Smooth shading interpolates the lighting across the surface of 3D models, made of numerous polygon meshes, to make them appear smoother. Faceted shading calculates light for each polygon individually, emphasizing the model's flat surfaces and sharp edges by applying light and shadow separately to each polygon.
Example: actor.Flat = 0.7
Data Types: double
Shadows
— Actor shadows
0
or false
(default) | 1
or true
Actor shadows, specified as 0
(false
) if the
actor does not cast shadows or 1
(true
) if it
does.
VertexBlend
— Color blending coefficient of vertices
0 (default) | real positive number in the range (0,1)
Color blending coefficient of vertices, specified as a real positive number in the range (0,1), where 0 indicates to display only the base color and 1 indicates to display only the vertex color. This value indicates how much of the base color blends with the specified vertex color.
Example: actor.VertexBlend = 0.5
TextureTransform
— Texture transformations applied to actor texture
real positive vector
Texture transformations applied to actor texture, specified as a real positive
vector. Use TextureTransform
to define texture position, velocity,
scale, and angle.
Transformation Properties
Property | Detail | Value | Value Example |
---|---|---|---|
Position | Use this property to set the position of the texture. You can use
|
| actor.TextureTransform.Position = [2 3] |
Velocity | Use this property to set the velocity of the texture movement. velocity is expressed as a change of U and V coordinates per second of simulation time. The animated surface has no effect on physical interactions. |
| actor.TextureTransform.Velocity = [2 3] |
Scale | Use this property to set the relative texture scale. If the texture is smaller than the surface to be covered, the scale repeats automatically in all directions. Negative values can be used to flip the texture in corresponding coordinate. |
| actor.TextureTransform.Scale = [2 2] |
TextureMapping
— Texture mapping parameters applied to actor texture
real positive vector
Texture mapping parameters applied to actor texture, specified as a real positive
vector. Use TextureMapping
to define texture blend, displacement,
bump factor, and roughness.
Mapping Properties
Property | Detail | Value | Value Example |
---|---|---|---|
Blend | Use this property to set the blend ratio of the texture. You can use To create an effect of glowing texture, use a black base color ([0 0 0]) and blend values greater than 1. You can set the value independently for each color channel ([red green blue]). |
| actor.TextureMapping.Blend = [1 1 0.5] |
Displacement | Use this property to set the displacement of the texture. You can use You can set the value independently for each color channel ([red green blue]) and its range is unlimited. |
| actor.TextureMapping.Displacement = [1 2 5] |
Bumps | Use this property to set the bump factor of the texture. You can use You can set the value independently for each color channel ([red green blue]) and its range is unlimited. |
| actor.TextureMapping.Bumps = [10 10 0.5] |
Roughness | Use this property to set the roughness factor of the texture. You can use You can set the value independently for each color channel ([red green blue]) and its range is unlimited. |
| actor.TextureMapping.Roughness = [1 1 0.5] |
Texture
— Source file for texture
'' (default) | character array
Source file for texture, specified as a character array. The supported file types are JPEG, PNG, and BMP. The file path should be absolute.
Note
For BMP files, only 8-bit files are supported.
Example: actor.Texture = fullfile(pwd,
"file.jpg")
TwoSided
— Two-sided visibility of actor surface
0
or false
(default) | 1
or true
Two-sided visibility of actor surface, specified as 0
(false
) if the actor is visible only from the outer side or
1
(true
) if the actor is visible from both the
inner and outer sides. When this property is false
, actor
performance improves, as the polygons facing away from the camera viewpoint are not
rendered.
Example: actor.TwoSided = 1
Specular
— Surface reflectivity
0.5
(default) | real positive number in the range (0,1)
Surface reflectivity, specified as a real positive number in the range (0,1). Use this property to control how shiny the surface of the actor appears.
Example: actor.Specular = 0.7
Data Types: double
Physical Attributes
LinearVelocity
— Linear velocity of actor
[0 0 0]
(default) | real 1-by-3 vector
Linear velocity of actor, specified as a real 1-by-3 vector, in m per second.
Example: actor.LinearVelocity = [1 1 1]
Dependencies
Mobility
should be set to
'sim3d.utils.MobilityTypes.Movable'
for velocities to work.
Otherwise the actor will not move, and you will see a warning.
AngularVelocity
— Angular velocity of actor
[0 0 0]
(default) | real 1-by-3 vector
Angular velocity of actor, specified as a real 1-by-3 vector, in rad per second.
Example: actor.AngularVelocity = [2 2 2]
Dependencies
Mobility
should be set to
sim3d.utils.MobilityTypes.Movable
for velocities to work.
Otherwise the actor will not move, and you will see a warning.
Mass
— Mass of actor
0
(default) | real positive scalar
Mass of actor, specified as a real positive scalar, in kg. The default value
0
specifies the mass of an empty actor. When you assign a shape
to the actor, the Unreal Engine determines the volume of the actor through its mesh geometry and
calculates the mass based on its volume and density of the material assigned to the
actor. The Unreal Engine sets a default density at 1000 kg per cubic meter.
Example: actor.Mass = 12
CenterOfMass
— Center of mass of actor
[0 0 0]
(default) | real positive vector
Center of mass of sim3d.Actor
object, specified as a real positive vector. Use this property to shift the center of
gravity from the origin of the local coordinate system.
Example: actor.CenterOfMass = [1 0 1]
Gravity
— Application of gravity to actor
0
or false
(default) | 1
or true
Application of gravity to actor, specified as 0
(false
) if no gravity is applied or 1
(true
) if gravity is applied.
Example: actor.Gravity = false
Dependencies
This property works when:
Physics
property is set to1
ortrue
.PreciseContact
property is set to0
orfalse
.
Mobility
should be set tosim3d.utils.MobilityTypes.Movable
for the actor to experience the effects of gravity. Otherwise the actor will not move, and you will see a warning.
Physics
— Reaction of actor to physical forces
0
or false
(default) | 1
or true
Reaction of actor to physical forces such as gravity and collision, specified as
0
(false
) or 1
(true
).
If Physics
is enabled, the actor moves independently of its
parent actor object but together with its children, unless the children also have
Physics
enabled.
Example: actor.Physics = true
Dependencies
This property works when PreciseContact
property is set to
0
or false
.
Collisions
— Object collision
1
or true
(default) | 0
or false
Object collision, specified as 0
(false
) for
no collision or 1
(true
) if objects will
collide.
Example: actor.Collisions = false
PreciseContacts
— Precise contacts
0
or false
(default) | 1
or true
Precise contacts during collisions, specified as 0
(false
) or 1
(true
).
Setting this value to true
allows the Unreal Engine to use a collision box that follows the actor mesh precisely. This
setting allows the software to detect collisions accurately.
Example: actor.PreciseContacts = true
Dependencies
Setting
PreciseContacts
property totrue
for an actor disables thePhysics
andGravity
properties.This property is not run-time configurable.
LocationLocked
— Stationary translational motion
0
or false
(default) | 1
or true
Stationary translational motion, specified as either 0
(false
) or 1
(true
). If
this property is enabled, the actor is fixed in place. If the actor has defined a
nonzero linear velocity, it interacts with other objects as if it were moving itself.
You can use this property to model belt conveyors.
Example: actor.LocationLocked = true
Dependencies
Physics
should be set to false
.
RotationLocked
— Stationary rotational motion
0
or false
(default) | 1
or true
Stationary rotational motion, specified as either 0
(false
) or 1
(true
). If
this property is enabled, the sim3d.Actor
object is fixed in place. If the actor has defined a nonzero angular velocity, it
interacts with other objects as if it were moving itself. You can use this property to
model circular conveyors (carousels).
Example: actor.RotationLocked = true
Dependencies
Physics
should be set to false
.
Hidden
— Option to hide actor
0
or false
(default) | 1
or true
Option to hide the actor from the 3D environment scene, specified as
0
(false
) if the actor is visible in the scene
or 1
(true
) if the actor is hidden in the
scene.
Example: actor.Hidden = 1
Friction
— Dynamic friction
0.7 (default) | real positive number in the range (0,1)
Dynamic friction, dimensionless, specified as a real positive number in the range (0,1). This property indicates the ease with which two actors can slide over each other. The value can only change in discrete steps of 0.1. When two actors slide over each other, the friction is the average value of both actors.
Example: actor.Friction = 0.4
Restitution
— Coefficient of restitution
0.3 (default) | real positive number in the range (0,1)
Coefficient of restitution, dimensionless, specified as a real positive number in the range (0,1). This property indicates how bouncy the collision is between two actors. The value can only change in discrete steps of 0.1. When two actors collide with each other, the coefficient of restitution is the average value of both actors.
Example: actor.Restitution = 0.5
Force
— Force applied to actor
[0 0 0]
(default) | real 1-by-3 vector
Force applied to actor, specified as real a 1-by-3 vector, in N. The acceleration
of the actor depends on the Mass
property of the actor and the
size of the simulation step specified by sampleTime
in run
.
Example: actor.Force = [0 5 0]
Dependencies
Physics
should be set to true
.
Torque
— Torque applied to actor
[0 0 0]
(default) | real 1-by-3 vector
Torque applied to actor, specified as a real 1-by-3 vector, in Nm. The angular
acceleration of the actor depends on the Mass
property of the
actor and the size of the simulation step specified by sampleTime
in run
.
Example: actor.Torque = [0 pi/2 0]
Dependencies
Physics
should be set to true
.
LinearDamping
— Level of linear movement resistance
0
(default) | real positive scalar
Level of linear movement resistance, specified as a real positive scalar. Use this property to control how much the actor can resist linear movement.
Example: actor.LinearDamping = 3
Dependencies
Physics
should be set to true
.
Data Types: double
AngularDamping
— Level of angular movement resistance
0
(default) | real positive scalar
Level of angular movement resistance, specified as a real positive scalar. Use this property to control how much the actor can resist angular movement.
Example: actor.AngularDamping = 3
Dependencies
Physics
should be set to true
.
Data Types: double
Event Attributes
HitEventEnabled
— Option to report hit event
0
or false
(default) | 1
or true
Option to report hit event, specified as 0
(false
) or 1
(true
). This
table provides the required HitEventEnabled
and
Collisions
property settings to report hit
events.
Hit Event Description | Actor HitEventEnabled Property | Actor Collisions Property |
---|---|---|
Actor 1 collides with Actor 2 | Actor 1 – Actor 2 –
| Actor 1 – Actor 2 –
|
Actor 2 collides with Actor 1 | Actor 1 – Actor 2 – | Actor 1 – Actor 2 –
|
Example: actor.HitEventEnabled = true
OverlapEventEnabled
— Option to report overlap event
0
or false
(default) | 1
or true
Option to report overlap event, specified as 0
(false
) or 1
(true
). This
table provides the required OverlapEventEnabled
and
Collisions
property settings to report begin overlap and end
overlap events.
Overlap Event Description | Actor OverlapEventEnabled Property | Actor Collisions Property |
---|---|---|
Actor 1 overlaps Actor 2 | Actor 1 – Actor 2 –
| Actor 1 – Actor 1 –
Actor 1 – |
Actor 2 overlaps Actor 1 | Actor 2 – Actor 1 –
| Actor 2 – Actor 2 –
Actor 2 – |
Example: actor.OverlapEventEnabled = true
HitEvent
— Hit event
0
or false
| 1
or true
This property is read-only.
Hit event for sim3d.Actor
object, specified as 0
(false
) or
1
(true
).
HitSelfID
— Hit sim3d.Actor
object identifier
real positive integer
This property is read-only.
Hit sim3d.Actor
object identifier, specified as a real positive integer.
HitOtherID
— Identifier of actor that collides with sim3d.Actor
object
real positive integer
This property is read-only.
Identifier of actor that collides with the sim3d.Actor
object, specified as a real positive integer.
HitLocation
— Hit event location
[0 0 0]
(default) | real 1-by-3 vector
This property is read-only.
Hit event location in the 3D environment, specified as a real 1-by-3 vector.
Data Types: double
HitOtherActorName
— Name of actor that collides with sim3d.Actor
object
character array | string
This property is read-only.
Name of actor that collides with the sim3d.Actor
object, specified as a character array or string.
BeginOverlapEvent
— Overlap begin event
0
or false
| 1
or true
This property is read-only.
Overlap begin event for sim3d.Actor
object, specified as 0
(false
) or
1
(true
).
BeginOverlapSelfID
— Identifier of overlapped sim3d.Actor
object
real positive integer
This property is read-only.
Identifier of the overlapped sim3d.Actor
object, specified as a real positive integer.
BeginOverlapOtherID
— Identifier of actor that overlaps with sim3d.Actor
object
real positive integer
This property is read-only.
Identifier of the actor that overlaps with the sim3d.Actor
object, specified as a real positive integer.
BeginOverlapOtherActorName
— Name of actor that overlaps with sim3d.Actor
object
character array | string
This property is read-only.
Name of actor that overlaps with the sim3d.Actor
object, specified as a character array or string.
EndOverlapEvent
— Overlap end event
0
or false
| 1
or true
This property is read-only.
Overlap end event for sim3d.Actor
object, specified as 0
(false
) or
1
(true
).
EndOverlapSelfID
— Identifier of sim3d.Actor
object ending overlap
real positive integer
This property is read-only.
Identifier of the sim3d.Actor
object that is ending overlap, specified as a real positive integer.
EndOverlapOtherID
— Identifier of actor that ends overlap with sim3d.Actor
object
real positive integer
This property is read-only.
Identifier of the actor that ends overlap with the sim3d.Actor
object, specified as a real positive integer.
EndOverlapOtherActorName
— Name of actor that ends overlap with sim3d.Actor
object
character array | string
This property is read-only.
Name of actor that ends overlap with the sim3d.Actor
object, specified as a character array or string.
ClickEvent
— Click event
0
or false
| 1
or true
This property is read-only.
Click event for sim3d.Actor
object, specified as 0
(false
) or
1
(true
).
Note
To report a click event, click an actor in the 3D environment.
ClickActorID
— Identifier of sim3d.Actor
object that is clicked
real positive integer
This property is read-only.
Identifier of the sim3d.Actor
object that is clicked, specified as a real positive integer.
ClickLocation
— Cartesian coordinates of the click event location
[0 0 0]
(default) | real 1-by-3 vector
This property is read-only.
Cartesian coordinates of the click event location in the 3D environment, specified as a real 1-by-3 vector.
Data Types: double
ClickActorName
— Name of clicked actor
character array | string
This property is read-only.
Name of clicked actor, specified as a character array or string.
Object Functions
copy | Copy all properties from another actor |
findBy | Find all actors that match specified criteria |
propagate | Propagate value of selected property to actor and its children |
gather | Return values of selected property from all objects in selected branch |
createMesh | Create new mesh with specified values |
addMesh | Append mesh on top of current mesh |
load | Load or import 3D file |
save | Save actor and children to a MAT file |
createShape | Create geometry for basic primitives |
Examples
Create World and Actor Using MATLAB
This example shows how to create a 3D environment with an empty actor and view in the Simulation 3D Viewer window using MATLAB®. You can use the sim3d.World
to create a world object and sim3d.Actor
to create an empty actor object. You can then add the actor to the 3D environment and visualize the 3D environment in the Simulation 3D Viewer window. For an example that shows how to create a 3D environment with an actor using Simulink®, see Create World and Actor Using Simulink.
This process does not build an appearance for the actor, so the Simulation 3D Viewer does not render a visualization of the actor. For an example that shows how to build an appearance for an empty actor, see Build Actor from 3D Graphic Primitives Using MATLAB.
Create World
Create a world object.
world = sim3d.World();
Create Actor
Create an actor object. The sim3d.Actor
object creates an empty actor without any visual meshes.
actor = sim3d.Actor();
Add the actor to the world.
add(world,actor);
Run Simulation
Run a simulation set for 10
seconds with a sample time of 0.02
seconds.
sampletime = 0.02; stoptime = 10; run(world,sampletime,stoptime);
Delete World
Delete the world object.
delete(world);
Version History
Introduced in R2022bR2024b: Material and physical properties
The sim3d.Actor
object has these material and physical properties.
Specular
: Set how shiny the actor surface appears.LinearDamping
: Set the actor resistance to linear movement.AngularDamping
: Set the actor resistance to angular movement.
R2024a: Removed
The Events
property is removed. Instead, use the
sim3d.Actor
object properties HitEventEnabled
and
OverlapEventEnabled
to report hit event and overlap events,
respectively in the Unreal Engine simulation 3D environment.
R2023b: Base properties
The sim3d.Actor
object has a base property,
CoordinateSystem
, to represent actor orientation.
R2023b: Physical properties
The sim3d.Actor
object has these new physical properties:
Hidden
hides actor visibility.Force
applies force to the actor.Torque
applies torque to the actor.
R2023b: Material properties
The sim3d.Actor
object has a material property,
TwoSided
, to render two sides of an actor surface.
R2023a: Communicate Unreal Engine Events
Use sim3d.Actor
object properties to communicate events in the
Unreal Engine simulation 3D environment, including when:
You click an actor.
An actor collides or overlaps with another actor.
You initialize an event callback for an actor.
R2023a: Precise Contacts
Use the PreciseContacts
property to allow Unreal Engine to precisely render collisions.
R2023a: Physical properties
The sim3d.Actor
object has these physical properties:
Friction
Restitution
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)