Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- surfacedata_t* C_BasePlayer::GetGroundSurface()
- {
- //
- // Find the name of the material that lies beneath the player.
- //
- Vector start, end;
- VectorCopy( GetAbsOrigin(), start );
- VectorCopy( start, end );
- // Straight down
- end.z -= 64;
- // Fill in default values, just in case.
- Ray_t ray;
- ray.Init( start, end, GetPlayerMins(), GetPlayerMaxs() );
- trace_t trace;
- UTIL_TraceRay( ray, MASK_PLAYERSOLID_BRUSHONLY, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );
- if ( trace.fraction == 1.0f )
- return NULL; // no ground
- return physprops->GetSurfaceData( trace.surface.surfaceProps );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement