Rotating Object Direction Calculation Without Physics-Engine Overflow
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for calculating the direction parameter of rotating objects in game scenes are prone to data overflow, leading to game interruptions.
Innovation Solution
A method that involves obtaining a first direction parameter and rotation angular velocity in a game frame, using an inter-frame interval duration to calculate a target rotation angle, and determining a second direction parameter based on this angle and the initial parameter, ensuring all values fall within the controllable range of the physics engine to avoid data overflow.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the direction parameter of a rotating object is calculated using conventional methods in game rendering, then the rotation effect can be achieved, but data overflow occurs causing game interruption
Solution Approach 1:
The patent applies parameter changes by transforming the calculation approach from directly computing direction parameters to first calculating rotation angles within a controlled range, then converting to direction parameters. This parameter transformation ensures intermediate values remain within representable ranges, preventing data overflow while maintaining rotation accuracy.
Solution Approach 2:
The patent introduces rotation angles as an intermediary parameter between the input rotation speed and the output direction parameter. By using rotation angles as a mediator that is constrained to a specific range, the system avoids direct computation of potentially overflowing direction parameters, thus preventing data overflow.
2Measurement precision
If the rotation calculation uses high precision values, then the rotation accuracy is improved, but the numerical values may exceed the physics engine's controllable range causing overflow
Solution Approach 1:
The patent changes the parameter representation by constraining rotation angles to a specific range (e.g., -π to π or 0 to 2π) rather than allowing unlimited precision values. This parameter constraint maintains sufficient rotation accuracy while ensuring all values remain within the physics engine's representable range, preventing data overflow.
3Measurement precision
If the rotation angular velocity is calculated without range limitation, then the rotation speed precision is maintained, but the product with inter-frame interval may exceed data type limits
Solution Approach 1:
The patent applies parameter changes by separating the rotation calculation into two stages: first computing the rotation angle as the product of angular velocity and time interval with full precision, then constraining this angle to a valid range before using it to compute direction parameters. This approach maintains rotation speed precision while preventing overflow in the final direction parameter calculation.
Data Source
AI summary
In a data processing method, a first direction parameter and a rotation angular velocity of a target object in a first game frame, and an inter-frame interval duration between the first game frame and a second game frame are obtained. The second game frame is rendered after the first game frame. A target rotation angle of the target object is obtained based on the rotation angular velocity and the inter-frame interval duration. A second direction parameter of the target object in the second game frame is determined based on the target rotation angle and the first direction parameter. Apparatus and non-transitory computer-readable storage medium counterpart embodiments are also contemplated.


