Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wz4: Cloud2 #57

Open
wzman opened this issue Jul 4, 2012 · 2 comments
Open

wz4: Cloud2 #57

wzman opened this issue Jul 4, 2012 · 2 comments

Comments

@wzman
Copy link
Contributor

wzman commented Jul 4, 2012

Hi

I was looking to add some new parameters for cloud2 - x and z rotation, because actual rotation is only on y axe.
The fix is pretty simple :

in fxparticle_ops.ops - operator Wz4Particles Cloud2() :

array
{
float30 Pos(-1000000..1000000 step 0.01);
float30 Scale(-1000000..1000000 step 0.01)=1;
float Speed(-1000000..1000000 step 0.01);
(-) float Rot(-16..16 step 0.01);
(+) float30 Rot(-16..16 step 0.01);
int Count(1..65536 step 16);
}

and in fxparticle.cpp - void RPCloud2::Init(Wz4ParticlesArrayCloud2 *Array,sInt ArrayCount)

(-) FastEulerXYZ(mat,0,Array[i].Rot,0);
(+) FastEulerXYZ(mat,Array[i].Rot.x,Array[i].Rot.y,Array[i].Rot.z);

It works great, but the problem is that is break backward compatibility, because there is a shift in "Array" due to the new size of Rot variable (float => float30), so "Count" in old files with Cloud2 is set to 0...

I thought to add the 2 new floats at end of array to keep actual structure order and avoid shift data but it's not very sexy because on parameters line you have "Count" between Rotations, like this => Rot(y) - Count - Rot(x) - Rot(z)...

I don't know how to do keep compatibility and have a clean parameter line. Do you have an idea ?
At worst I can correct example.wz4 to fix all Cloud2...

Thanks

@rygorous
Copy link
Contributor

rygorous commented Jul 7, 2012

You can't change the ordering, it'll break file format compatibility with existing Wz4 files, including the source wz4 files for several FR demos that we plan to make available.

There's ways to reorder parameters outside of arrays, but I'm not sure if you can use that in this case - Chaos would need to answer that.

@wzman
Copy link
Contributor Author

wzman commented Jul 9, 2012

Possible solution with offsets :

array
{
  float30 Pos:0(-1000000..1000000 step 0.01);
  float30 Scale:3(-1000000..1000000 step 0.01)=1;
  float Speed:6(-1000000..1000000 step 0.01);
  int Count:8(1..65536 step 16);
  float Rotx  :9(-16..16 step 0.01);
  float Roty  :7(-16..16 step 0.01);
  float Rotz  :10(-16..16 step 0.01);
}

inconvenient we have 3 labels (rotx, roty, rotz) instead of 1 (----- rot -----)...
What do you think about it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants