Class LookAtBehavior
Behavior that allows an entity to look to the camera or another entity.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Components.Toolkit
Assembly: Evergine.Components.dll
Syntax
public class LookAtBehavior : Behavior, IDependencyObject
Fields
transform
The owner transform.
Declaration
[BindComponent(true, true, BindComponentSource.Owner, null, true)]
protected Transform3D transform
Field Value
Type | Description |
---|---|
Transform3D |
Properties
Axis
Gets or sets a value indicating the axis of the entity to be aligned.
Declaration
[RenderProperty(Tooltip = "The axis of the entity used for the alignment")]
public LookAtBehavior.AxisEnum Axis { get; set; }
Property Value
Type | Description |
---|---|
LookAtBehavior.AxisEnum |
AxisConstraint
Gets or sets a value indicating whether the entity look at the target rotating just in one axis.
Declaration
[RenderProperty(Tag = 1, CustomPropertyName = "Axis Constraint", Tooltip = "If true, the orientation is restricted to just one axis.")]
public bool AxisConstraint { get; set; }
Property Value
Type | Description |
---|---|
bool |
Flip
Gets or sets a value indicating whether the alignment is flipped.
Declaration
[RenderProperty(Tooltip = "Flips the alignment")]
public bool Flip { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsLocalOriented
Gets or sets a value indicating whether the alignment is in local axis or absolute axis.
Declaration
[RenderProperty(AttachToTag = 1, AttachToValue = true, CustomPropertyName = "Is Local Oriented", Tooltip = "If true, the constraint alignment is made using local orientations")]
public bool IsLocalOriented { get; set; }
Property Value
Type | Description |
---|---|
bool |
KeepUpVector
Gets or sets a value indicating whether the up vector must be always up.
Declaration
[RenderProperty(AttachToTag = 1, AttachToValue = true, Tooltip = "Keep up vector.")]
public bool KeepUpVector { get; set; }
Property Value
Type | Description |
---|---|
bool |
LookAtEntity
Gets or sets a value indicating whether the entity looks to another entity, instead of the camera.
Declaration
[RenderProperty(Tag = 2, CustomPropertyName = "Look At Entity", Tooltip = "If true, the entity looks at another entity. If false, it looks to the camera")]
public bool LookAtEntity { get; set; }
Property Value
Type | Description |
---|---|
bool |
OrientationAxis
Gets or sets a value indicating the rotating axis of the alignment.
Declaration
[RenderProperty(AttachToTag = 1, AttachToValue = true, CustomPropertyName = "Orientation Axis", Tooltip = "The constraint axis used by the entity to orientate to its target")]
public LookAtBehavior.AxisEnum OrientationAxis { get; set; }
Property Value
Type | Description |
---|---|
LookAtBehavior.AxisEnum |
TargetEntity
Gets or sets the target entity path.
Declaration
public Entity TargetEntity { get; set; }
Property Value
Type | Description |
---|---|
Entity |
Methods
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
Update(TimeSpan)
Updates the behavior.
Declaration
protected override void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The elapsed game time. |