Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddAttachedPropToProp is broken?
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#1
AddAttachedPropToProp is broken?

The function as described in the wiki.
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);
However, upon usage i found that "afPosZ" does nothing, and "afRotz" controls both the Z-position and the Z-rotation. I set up a subdivision routine, to illustrate this point.

Image 1: "Swapped" order
Image 2: Order as described in wiki

In the second image, you can see that whilst there is clearly no rotation, there is also no depth, the Z-position parameter was ignored. When looking at the first image there is depth, but also a rotation around zx - the rotation parameter counted as both!

Below is the relevant function call I am making in my code:
//First image (Which shouldn't behave like this)
AddAttachedPropToProp(cp00,_cpQUAD,"sdiv"+sz+".ent",dx,dy,0,0,0,dz);
//Second image (Which should be correct!)
AddAttachedPropToProp(cp00,_cpQUAD,"sdiv"+sz+".ent",dx,dy,dz,0,0,0);

Any workarounds or chance of a fix? Smile

UPDATE:
Turns out it really is broken in that way, the following function fixes the problem, provided you do not want the attached prop to be rotated:
void FixedAttachPropToProp(string target, string attach, string entity, float x, float y, float z) {
   AddAttachedPropToProp(target,attach,entity,x,y,0,z,90,z); }
(This post was last modified: 07-25-2011, 01:38 AM by Apjjm.)
07-25-2011, 01:01 AM
Find




Users browsing this thread: 1 Guest(s)