sui228 Posted November 19, 2020 Posted November 19, 2020 (edited) I need to know the distance to the transport when I look at it. In JavaScript it would look something like this: mp.raycasting.testPointToPoint(first position, second position, mp.players.local); But I didn't find it in c#. How to use raycasting in c#? I thank you all in advance. Edited November 19, 2020 by sui228 i complemented this theme
sui228 Posted November 21, 2020 Author Posted November 21, 2020 OK, I found a solution to my problem.
horex Posted March 2, 2021 Posted March 2, 2021 В 21.11.2020 в 08:52, sui228 сказал: OK, I found a solution to my problem. Can you tell me a solution?
DaVilka Posted May 7, 2021 Posted May 7, 2021 В 03.03.2021 в 02:36, horex сказал: Can you tell me a solution? RAGE.Game.Shapetest == mp.raycasting Vector3 headPos = player.GetBoneCoords(31086, 0.0f, 0.0f, 0.0f); Vector3 offsetPos = RAGE.Game.Entity.GetOffsetFromEntityInWorldCoords(player.Handle, 0.0f, 20.0f, -10.0f); RAGE.Game.Graphics.DrawLine(headPos.X, headPos.Y, headPos.Z, offsetPos.X, offsetPos.Y, offsetPos.Z, 255, 0, 0, 255); int resultShape = RAGE.Game.Shapetest.StartShapeTestRay(headPos.X, headPos.Y, headPos.Z, offsetPos.X, offsetPos.Y, offsetPos.Z, 1, player.Handle, 7); int hit = -1; Vector3 endCoords = new Vector3(); Vector3 surfaseNormal = new Vector3(); int endEndidty = -1; int result = RAGE.Game.Shapetest.GetShapeTestResult(resultShape, ref hit, endCoords, surfaseNormal, ref endEndidty); if(result != 0) RAGE.Game.Graphics.DrawMarker(28, endCoords.X, endCoords.Y, endCoords.Z, 0.0f, 0.0f, 0.0f, 0.0f, 180.0f, 0.0f, 0.2f, 0.2f, 0.2f, 255, 128, 0, 50, false, true, 2, false, null, null, false);
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