it: physics bug 2
This commit is contained in:
parent
dbae80b1d2
commit
1f73a8b5c6
@ -857,6 +857,12 @@ impl Default for PhysicsState{
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PhysicsState{
|
impl PhysicsState{
|
||||||
|
pub fn new_at_position(position:Planar64Vec3)->Self{
|
||||||
|
Self{
|
||||||
|
body:Body::new(position,vec3::int(0,0,0),vec3::int(0,-100,0),Time::ZERO),
|
||||||
|
..Self::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
pub fn camera_body(&self)->Body{
|
pub fn camera_body(&self)->Body{
|
||||||
Body{
|
Body{
|
||||||
position:self.body.position+self.style.camera_offset,
|
position:self.body.position+self.style.camera_offset,
|
||||||
|
@ -9,10 +9,35 @@ fn main(){
|
|||||||
match arg.as_deref(){
|
match arg.as_deref(){
|
||||||
Some("determinism")|None=>test_determinism().unwrap(),
|
Some("determinism")|None=>test_determinism().unwrap(),
|
||||||
Some("replay")=>run_replay().unwrap(),
|
Some("replay")=>run_replay().unwrap(),
|
||||||
|
Some("bug2")=>physics_bug_2().unwrap(),
|
||||||
_=>println!("invalid argument"),
|
_=>println!("invalid argument"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn physics_bug_2()->Result<(),ReplayError>{
|
||||||
|
println!("loading map file..");
|
||||||
|
let data=read_entire_file("/run/media/quat/Files/Documents/map-files/strafesnet/maps/bsp_to_snf/bhop_monster_jam.snfm")?;
|
||||||
|
let map=strafesnet_snf::read_map(data)?.into_complete_map()?;
|
||||||
|
|
||||||
|
// create recording
|
||||||
|
let mut physics_data=PhysicsData::default();
|
||||||
|
println!("generating models..");
|
||||||
|
physics_data.generate_models(&map);
|
||||||
|
println!("simulating...");
|
||||||
|
|
||||||
|
//teleport to bug
|
||||||
|
// body pos = Vector { array: [Fixed { bits: 554895163352 }, Fixed { bits: 1485633089990 }, Fixed { bits: 1279601007173 }] }
|
||||||
|
let mut physics=PhysicsState::new_at_position(strafesnet_common::integer::vec3::raw_xyz(554895163352,1485633089990,1279601007173));
|
||||||
|
// wait one second to activate the bug
|
||||||
|
// hit=Some(ModelId(2262))
|
||||||
|
PhysicsContext::run_input_instruction(&mut physics,&physics_data,strafesnet_common::instruction::TimedInstruction{
|
||||||
|
time:strafesnet_common::integer::Time::ONE_SECOND,
|
||||||
|
instruction:strafesnet_common::physics::Instruction::Idle,
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum ReplayError{
|
enum ReplayError{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user