Improved particles and trajectory rendering #430
|
@ -166,7 +166,7 @@
|
||||||
Maximum Speed: 6
|
Maximum Speed: 6
|
||||||
Minimum Size: 0
|
Minimum Size: 0
|
||||||
Maximum Size: 0.5
|
Maximum Size: 0.5
|
||||||
Angular Ranges And Offset: {x: 0.699999988, y: 0.469999999, z: 0, w: 0}
|
Angular Ranges And Offset: {x: 6.19999981, y: 1.10000002, z: 0, w: 0.100000001}
|
||||||
Rotation Speed: 0
|
Rotation Speed: 0
|
||||||
Texture Asset ID: 63456868
|
Texture Asset ID: 63456868
|
||||||
IsActive: true
|
IsActive: true
|
||||||
|
|
|
@ -137,9 +137,24 @@ void main()
|
||||||
rand(seed) * angularRangesAndOffsets.y + angularRangesAndOffsets.w);
|
rand(seed) * angularRangesAndOffsets.y + angularRangesAndOffsets.w);
|
||||||
|
|
||||||
// Set its velocity
|
// Set its velocity
|
||||||
particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y),
|
// particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y),
|
||||||
sin(eulerAngles.x) * cos(eulerAngles.y),
|
// sin(eulerAngles.x) * cos(eulerAngles.y),
|
||||||
sin(eulerAngles.y));
|
// sin(eulerAngles.y));
|
||||||
|
|
||||||
|
float bank = eulerAngles.y;
|
||||||
|
float cb = cos(bank);
|
||||||
|
float sb = sin(bank);
|
||||||
|
float ch = cos (eulerAngles.x);
|
||||||
|
float sh = sin (eulerAngles.x);
|
||||||
|
float cp = cos (0.0f);
|
||||||
|
float sp = sin (0.0f);
|
||||||
|
|
||||||
|
particle.velocity.xyz = mat3 (
|
||||||
|
(ch * cb + sh * sp * sb), (sb * cp), (-sh * cb + ch * sp * sb),
|
||||||
|
(-ch * sb + sh * sp * cb), (cb * cp), ( sb * sh + ch * sp * cb),
|
||||||
|
(sh * cp), (-sp), (ch * cp)
|
||||||
|
) * vec3 (1.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
|
||||||
particle.velocity *= map (rand (seed), 0.0f, 1.0f, minSpeed.x, maxSpeed.x);
|
particle.velocity *= map (rand (seed), 0.0f, 1.0f, minSpeed.x, maxSpeed.x);
|
||||||
|
|
||||||
|
@ -162,7 +177,7 @@ void main()
|
||||||
particle.orientationSpeedDecay = vec4 (0.0f);
|
particle.orientationSpeedDecay = vec4 (0.0f);
|
||||||
|
|
||||||
|
|
||||||
particle.acceleration = vec4 (0.01f);
|
particle.acceleration = vec4 (0.0f, -0.058f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
|
||||||
inputParticles.data[index] = particle;
|
inputParticles.data[index] = particle;
|
||||||
|
|
Binary file not shown.
|
@ -120,6 +120,7 @@ void main()
|
||||||
{
|
{
|
||||||
// update position from velocity
|
// update position from velocity
|
||||||
particle.position += particle.velocity * genericDataBuffer.data.dt;
|
particle.position += particle.velocity * genericDataBuffer.data.dt;
|
||||||
|
particle.velocity += particle.acceleration;
|
||||||
particle.life -= genericDataBuffer.data.dt;
|
particle.life -= genericDataBuffer.data.dt;
|
||||||
|
|
||||||
if (particle.life < 0.0f || particle.scaleAndDecay.x < 0.0f || particle.scaleAndDecay.y < 0.0f)
|
if (particle.life < 0.0f || particle.scaleAndDecay.x < 0.0f || particle.scaleAndDecay.y < 0.0f)
|
||||||
|
|
Binary file not shown.
|
@ -831,7 +831,7 @@ namespace SHADE
|
||||||
SHEditorWidgets::DragFloat("Min Size", [comp = component]() {return comp->GetMinSize(); }, [comp = component](float val) {comp->SetMinSize(val); });
|
SHEditorWidgets::DragFloat("Min Size", [comp = component]() {return comp->GetMinSize(); }, [comp = component](float val) {comp->SetMinSize(val); });
|
||||||
SHEditorWidgets::DragFloat("Max Size", [comp = component]() {return comp->GetMaxSize(); }, [comp = component](float val) {comp->SetMaxSize(val); });
|
SHEditorWidgets::DragFloat("Max Size", [comp = component]() {return comp->GetMaxSize(); }, [comp = component](float val) {comp->SetMaxSize(val); });
|
||||||
|
|
||||||
SHEditorWidgets::DragVec4("Angles and Offsets", {"yaw", "pitch", "yaw off", "pitch off"},
|
SHEditorWidgets::DragVec4("Angles and Offsets", {"yaw", "bank", "yaw off", "bank off"},
|
||||||
[comp = component]()
|
[comp = component]()
|
||||||
{
|
{
|
||||||
return comp->GetAngularRangesAndOffsets();
|
return comp->GetAngularRangesAndOffsets();
|
||||||
|
|
Loading…
Reference in New Issue