blendFactor
The degree at which the entity rotates toward the camera.
Declaration
var blendFactor: FloatDiscussion
The blendFactor property is a floating-point number in the range [0.0, 1.0].
When
blendFactoris1.0, the entity fully faces the camera. This is the default behavior.When
blendFactoris0.0, the entity doesn’t rotate at all.When
blendFactoris between0.0and1.0, the entity partially rotates toward the camera.
The following example configures the entity to rotate by half the angle it needs to directly face the camera by setting the blendFactor to 0.5:
var billboard = BillboardComponent()
billboard.blendFactor = 0.5
entity.components.set(billboard)For example, here’s how a few different blendFactor values affect the orientation:
0 | 0.25 | 0.5 | 1 |
|---|---|---|---|
[Image] | [Image] | [Image] | [Image] |
For an example of how to animate blendFactor, see BillboardAction.