dxx-rebirth/common/main/physics.h

80 lines
2.2 KiB
C
Raw Normal View History

2006-03-20 17:12:09 +00:00
/*
2014-06-01 17:55:23 +00:00
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
2006-03-20 17:12:09 +00:00
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
*
* Headers for physics functions and data
*
*/
#ifndef _PHYSICS_H
#define _PHYSICS_H
#include "vecmat.h"
#include "fvi.h"
#include "fwd-window.h"
2006-03-20 17:12:09 +00:00
#ifdef __cplusplus
2006-03-20 17:12:09 +00:00
//#define FL_NORMAL 0
//#define FL_TURBO 1
//#define FL_HOVER 2
//#define FL_REVERSE 3
// Simulate a physics object for this frame
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
struct phys_visited_seglist
{
unsigned nsegs;
2020-05-02 21:18:42 +00:00
std::array<segnum_t, MAX_FVI_SEGS> seglist;
};
#ifdef dsx
namespace dsx {
window_event_result do_physics_sim(vmobjptridx_t obj, const vms_vector &obj_previous_position, phys_visited_seglist *phys_segs);
2006-03-20 17:12:09 +00:00
}
#endif
2016-04-06 03:34:14 +00:00
namespace dcx {
2006-03-20 17:12:09 +00:00
// Applies an instantaneous force on an object, resulting in an instantaneous
// change in velocity.
2016-04-06 03:34:14 +00:00
void phys_apply_force(object_base &obj, const vms_vector &force_vec);
}
2016-04-06 03:34:14 +00:00
namespace dsx {
void phys_apply_rot(object &obj, const vms_vector &force_vec);
}
2006-03-20 17:12:09 +00:00
// this routine will set the thrust for an object to a value that will
// (hopefully) maintain the object's current velocity
2016-07-15 03:43:01 +00:00
namespace dcx {
void set_thrust_from_velocity(object_base &obj);
}
void check_and_fix_matrix(vms_matrix &m);
namespace dcx {
void physics_turn_towards_vector(const vms_vector &goal_vector, object_base &obj, fix rate);
}
#endif
2006-03-20 17:12:09 +00:00
#endif
2006-03-20 17:12:09 +00:00
#endif /* _PHYSICS_H */