View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001586 | FSSCP | scripting | public | 2008-01-24 03:38 | 2008-03-24 05:59 |
| Reporter | Nuke | Assigned To | WMCoolmon | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.6.9 | ||||
| Summary | 0001586: vector multiply and devide dont seem to work | ||||
| Description | seems like any time i try to multiply or divide 2 vectors, i get a zeroed result. im using the latest scripting debug build, or the Srs bsnss build. this doesnt appear to effect vector * number or vector / number. see sample script. | ||||
| Additional Information | #Conditional Hooks $State: GS_STATE_GAME_PLAY $On Frame: [ ship = mn.Ships["Alpha 1"] if ship:isValid() then local dvec = ship.Physics.RotationalVelocityDesired local mvec = ship.Physics.RotationalVelocityMax local avec = dvec / mvec local bvec = dvec * mvec gr.drawString(dvec.x.." "..dvec.y.." "..dvec.z,5,50) gr.drawString(mvec.x.." "..mvec.y.." "..mvec.z) gr.drawString(avec.x.." "..avec.y.." "..avec.z) gr.drawString(bvec.x.." "..bvec.y.." "..bvec.z) end ] #end | ||||
| Tags | No tags attached. | ||||
|
|
Umh.. AFAIK vectors are generally not multiplied with another vector - not directly any way. In general you either use scale-vector multiplication, or dot or cross product of two vectors. Or combination of there-of. |
|
|
Right. Vector multiplication and division isn't defined mathematically, at least not AFAIK. What were you trying to accomplish with it? |
|
|
it has its uses for dealing with euler angles. mainly i was using it for capturing joystick data from the players ship on a -1 to 1 (as a vector to store roll pitch and yaw) scale and multiplying that by another vector containing values to be scaled. in this case i was essentially trying to do this: XYZ = ship.Physics.RotationalVelocityDesired / ship.Physics.RotationalVelocityMax instead of this: X = ship.Physics.RotationalVelocityDesired.y / ship.Physics.RotationalVelocityMax.y Y = ship.Physics.RotationalVelocityDesired.x / ship.Physics.RotationalVelocityMax.x Z = ship.Physics.RotationalVelocityDesired.z / ship.Physics.RotationalVelocityMax.z really im just being lazy. i could have sworn i saw a vector multiply in the scripting.html at some point (i probably confused it with something out of one of my c++ projects). |
|
|
Makes sense. I updated this in my local codebase, it'll be in my next build. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2008-01-24 03:38 | Nuke | New Issue | |
| 2008-01-24 03:38 | Nuke | Status | new => assigned |
| 2008-01-24 03:38 | Nuke | Assigned To | => WMCoolmon |
| 2008-01-25 23:42 | Wanderer | Note Added: 0008838 | |
| 2008-03-23 11:06 | WMCoolmon | Note Added: 0009016 | |
| 2008-03-24 03:04 | Nuke | Note Added: 0009024 | |
| 2008-03-24 03:05 | Nuke | Note Edited: 0009024 | |
| 2008-03-24 05:59 | WMCoolmon | Note Added: 0009025 | |
| 2008-03-24 05:59 | WMCoolmon | Status | assigned => resolved |
| 2008-03-24 05:59 | WMCoolmon | Resolution | open => fixed |