private void PassOnStrikeCmd(String msg) { fc = ForceCommand.getFc(msg); if (fc.F > 0.0f) { tables[fc.table_id].Fc = fc; tables[fc.table_id].enabled = true; } }
void Awake() { fc = new ForceCommand(0.0f, 0.0f, 0.0f, 0.0f, 0); pipeline = new ProcessPipeline(); pipeline.StartPipeLine(); SimTimer = new Stopwatch(); SimFlags = EMPTYHOUSE_FLAG; SimUpdateTimer = new Stopwatch(); SimUpdateTimer.Start(); //SimGameState.jsonprototype(); }
public void ApplyForce(ForceCommand fc) { // cue.velocity = Vector3.zero; cue.rotation = Quaternion.identity; Vector3 force_vec = fc.ConvertToVector(); Vector3 impact_loc = new Vector3(cue.position.x + fc.a, cue.position.y + fc.b, cue.position.z); // Vector3 impact_loc = new Vector3(cue.position.x + BallRadius * Mathf.Cos(fc.phsi), // cue.position.y, // cue.position.z + BallRadius * Mathf.Sin(fc.phsi)); cue.AddForceAtPosition(force_vec, impact_loc, ForceMode.VelocityChange); //cue.AddForce(force_vec,ForceMode.VelocityChange); //Debug.Log(force_vec.ToString()+" "+ impact_loc.ToString()); }