From 4626b8246c2bca4993d75673714daa27071b6538 Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Thu, 4 May 2023 21:06:31 -0400 Subject: debug acceleration display pulley --- .../nodes/PhysicsBox/PhysicsSimulationWeight.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx index 3ab78e339..30c78cd94 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx @@ -187,12 +187,20 @@ export default class Weight extends React.Component { this.setXPosDisplay(xPos); this.setYVelDisplay(yVel); this.setXVelDisplay(xVel); - this.props.dataDoc['accelerationYDisplay'] = - (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100 - ; - this.props.dataDoc['accelerationXDisplay'] = - Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100 - ; + if (this.props.color == 'red') { + this.props.dataDoc['accelerationYDisplay'] = + (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100 + ; + this.props.dataDoc['accelerationXDisplay'] = + Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100 + ; + } else { + this.props.dataDoc['accelerationYDisplay2'] = + (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100 + ; + this.props.dataDoc['accelerationXDisplay2'] = + Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100 + ;} this.setState({xAccel : (Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100)}) this.setState({yAccel : -- cgit v1.2.3-70-g09d2