LostDerp Posted February 1, 2012 Share Posted February 1, 2012 Is there anyway to do any trace to find where there's collision within a line of sight? Or is there anyway to get the collision at a certain point? Link to comment Share on other sites More sharing options...
jitsuin Posted February 1, 2012 Share Posted February 1, 2012 (edited) jydnjydrbut Edited February 3, 2012 by jitsuin Link to comment Share on other sites More sharing options...
thaCURSEDpie Posted February 11, 2012 Share Posted February 11, 2012 There is no cheap way I know of. There are a number of ways though, some of which I've tried. The best I've come up with: Asynchronous method Create a new class which inherits the GTA.Timer class. Give it a GTA.Object property - this will be used for the col-detection. Upon creating the tracer object, create a small object (CJ_PROP_GRENADE works well) at the specified startposition. Give the object a specific velocity, the direction of which should be equal to the search direction, but the size (speed) should always be constant. In the OnTickEvent of the class, set the object's velocity to the specified one. However, before you do so, check the current velocity against the 'ideal' velocity. If the velocity has changed too much (slowed down, change in velocity-direction), there has been a collision. Save the object's coordinates and call the callback specified when creating the tracer object. Pros: - asynchronous, thus non-blocking - no search-length / distance limit Cons: - relatively slow (~0.5 s / search: unsuitable for realtime tracing). Something else you could try is hooking DirectX and using some D3D function (though I don't have a lot of experience with that. Hooking D3D is pretty easy though) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now