forked from StrafesNET/strafe-client
use pva for init
This commit is contained in:
parent
5a886b76d1
commit
21ae7a0e4f
@ -278,11 +278,11 @@ impl RelativeCollision {
|
|||||||
pub type TIME = i64;
|
pub type TIME = i64;
|
||||||
|
|
||||||
impl Body {
|
impl Body {
|
||||||
pub fn with_position(position:glam::Vec3) -> Self {
|
pub fn with_pva(position:glam::Vec3,velocity:glam::Vec3,acceleration:glam::Vec3) -> Self {
|
||||||
Self{
|
Self{
|
||||||
position: position,
|
position,
|
||||||
velocity: glam::Vec3::ZERO,
|
velocity,
|
||||||
acceleration: glam::Vec3::ZERO,
|
acceleration,
|
||||||
time: 0,
|
time: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ impl strafe_client::framework::Example for Skybox {
|
|||||||
controls:0,
|
controls:0,
|
||||||
};
|
};
|
||||||
let physics = strafe_client::body::PhysicsState {
|
let physics = strafe_client::body::PhysicsState {
|
||||||
body: strafe_client::body::Body::with_position(glam::Vec3::new(5.0,5.0,5.0)),
|
body: strafe_client::body::Body::with_pva(glam::vec3(0.0,50.0,0.0),glam::vec3(0.0,0.0,0.0),glam::vec3(0.0,-100.0,0.0)),
|
||||||
time: 0,
|
time: 0,
|
||||||
tick: 0,
|
tick: 0,
|
||||||
strafe_tick_num: 100,//100t
|
strafe_tick_num: 100,//100t
|
||||||
|
Loading…
Reference in New Issue
Block a user