Discuss about `rvx, rvy` in `collection-map.js`
Discuss about rvx, rvy in collection-map.js
there is a function with arguments named rvx, rvy , What do they mean? what's the full name ?
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L63
the _traceStep() be called with vx & vy
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L44
Why do you pass vx , vy ? in my opinion , at line 44 , It should pass sx ,sy
the function _traceStep has arguments rvx, rvy , and pass them into _checkTileDef()
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L95
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L104
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L142
https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L150
Why do you pass rvx , rvy ? in my opinion , at line 44 , It should pass vx ,vy.
I post a PR , Just for comparing the differences in the code
https://github.com/phoboslab/Impact/pull/100/files
If change the code to my version, will there be any problems?
Maybe "rvx" means "reference to vx", since the value appears to come from "vx" on line 44.
-------- Original Message -------- On 3/25/25 9:46 PM, finscn wrote:
Discuss about rvx, rvy in collection-map.js
there is a function with arguments named rvx, rvy , What do they mean? what's the full name ? https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L63
_traceStep
:
function
(
res
,
x
,
y
,
vx
,
vy
,
width
,
height
,
rvx
,
rvy
,
step
)
the _traceStep() be called with vx & vy https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L44
this
.
_traceStep
(
res
,
x
,
y
,
sx
,
sy
,
objectWidth
,
objectHeight
,
vx
,
vy
,
i
)
;
Why do you pass vx , vy ? in my opinion , at line 44 , It should pass sx ,sy
the function _traceStep has arguments rvx, rvy , and pass them into _checkTileDef() https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L95
_traceStep:
function
(
res
,
x
,
y
,
vx
,
vy
,
width
,
height
,
rvx
,
rvy
,
step
)
{
// ......
this
.
_checkTileDef
(
res
,
t
,
x
,
y
,
rvx
,
rvy
,
width
,
height
,
tileX
,
tileY
)
// ......
}
Why do you pass rvx , rvy ? in my opinion , at line 44 , It should pass vx ,vy.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
[finscn]finscn created an issue (phoboslab/Impact#99)
Discuss about rvx, rvy in collection-map.js
there is a function with arguments named rvx, rvy , What do they mean? what's the full name ? https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L63
_traceStep
:
function
(
res
,
x
,
y
,
vx
,
vy
,
width
,
height
,
rvx
,
rvy
,
step
)
the _traceStep() be called with vx & vy https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L44
this
.
_traceStep
(
res
,
x
,
y
,
sx
,
sy
,
objectWidth
,
objectHeight
,
vx
,
vy
,
i
)
;
Why do you pass vx , vy ? in my opinion , at line 44 , It should pass sx ,sy
the function _traceStep has arguments rvx, rvy , and pass them into _checkTileDef() https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L95
_traceStep:
function
(
res
,
x
,
y
,
vx
,
vy
,
width
,
height
,
rvx
,
rvy
,
step
)
{
// ......
this
.
_checkTileDef
(
res
,
t
,
x
,
y
,
rvx
,
rvy
,
width
,
height
,
tileX
,
tileY
)
// ......
}
Why do you pass rvx , rvy ? in my opinion , at line 44 , It should pass vx ,vy.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Regarding your pull request, the _traceStep function takes 10 arguments, so I don't know why you're deleting arguments from your calls. You're passing too few arguments (only 8). Why are you doing that?
Regarding your pull request, the _traceStep function takes 10 arguments, so I don't know why you're deleting arguments from your calls. You're passing too few arguments (only 8). Why are you doing that?
because I think rvx rvy is useless , I removed them from _traceStep()'s definition
If it is true that they are useless, then those arguments would need to be removed from the function signature too.
Why are they useless though?
rvx and rvy ist the "real velocity".
_traceStep is called like this: https://github.com/phoboslab/Impact/blob/7768fd29c70ca924a78673d93081baab5a72fbe6/lib/impact/collision-map.js#L40-L44
This is passing the velocity for one step (sx, sy named vx, vy in _traceStep) and the real/full velocity of the object (vx, vy named rvx, rvy in _traceStep). The real velocity is not needed for collision detection, but later (in checkTileDef) for resolving the collision.
Simple example: you hit the ground at an angle. The resolved y position will be the impact position, the x position however will incorporate the x velocity, essentially sliding you over the ground. Here the real x velocity is needed, not the x velocity for just one step of collision detection.
@phoboslab thanks . but if use real/full velocity , the target point ( x+ rvy , y+ rvy) or it's pedal may be out of the slope-tile's bounding .
should we use the red point ?