Quote:
Originally Posted by ZASTRELIS
I use my code for excepting cutom spinning which I do when grenade touches to worldspawn. Distance needed only for stop spinning, because server_frame() fire each spin in some degree. So I unneeded to change angle of grenade within ground angle, because hlds do this byself. Only +5 to Z axis for little incline, and X axis correction as 0.0
EngFunc_PointContents I not fully understand how it works, and not sure that it is suitable
As I said before I use server_frame(), while() not applicable in that native
Looked at your video, and think that angle correction should take place, but excelent correction for your ent is very hard for this engine, and not profitable
What you say about if you tried enable some gravity for your ent and disable friction, maybe it would be looks better in motion? Wheels do not rotate)
|
That video is of a very primitive version where only origin physics are implemented meaning it will never rotate but can move around without flying or clipping ground
I only posted it to showcase the code that checks distance to ground using the method I initially provided, so pretty much the part where it's rolling down the slope and keeps touching the ground, the image I posted is what's keeping it on the ground
I got inspiration from is_user_outside stock used in weather plugins, which does the same thing to check if sky is directly above player
You can use this to get distance to ground (by looping to ground origin then subtracting z coordinate from original position)
Assuming your entity is a single point, stock to check if in ground might work like this
- get origin
- origin_s = origin
- origin_s[2] -= 1;
If point contents origin !=solid AND point contents origin_s ==solid then is on ground
On phone so i cant write code
__________________