⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newton.htm

📁 Newton Game Dynamic 1.52 Delphi下基于GLScene的OpenGL游戏开发控件。功能非常强大和易于使用。 Advanced physics engine for re
💻 HTM
📖 第 1 页 / 共 5 页
字号:
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> state
</td>
<td class=DefSep>-</td>
<td class=DefText>
state for this material: 1 = continue collision on; 0 = continue collision off, default mode is on
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> continue collision mode enable allow the engine to predict colliding contact on rigid bodies
   Moving at high speed of subject to strong forces.
  
<p>   <h4>Remarks</h4> continue collision mode does not prevent rigid bodies from interpenetration instead it prevent bodies from 
   passing trough each others by extrapolating contact points when the bodies normal contact calculation determine the bodies are not colliding. 
  
<p>   <h4>Remarks</h4> for performance reason the bodies angular velocities is only use on the broad face of the collision, 
   but not on the contact calculation. 
   
<p>   <h4>Remarks</h4> continue collision does not perform back tracking to determine time of contact, instead it extrapolate contact by incrementally 
   extruding the collision geometries of the two colliding bodies along the linear velocity of the bodies during the time step, 
   if during the extrusion colliding contact are found, a collision is declared and the normal contact resolution is called. 
  
<p>   <h4>Remarks</h4> for continue collision to be active the continue collision mode must on the material pair of the colliding bodies as well as on at least one of the two colliding bodies.
  
<p>   <h4>Remarks</h4> Because there is penalty of about 40% to 80% depending of the shape complexity of the collision geometry, this feature is set 
   off by default. It is the job of the application to determine what bodies need this feature on. Good guidelines are: very small objects, 
   and bodies that move a height speed.  
   
<p>   <h4>See also</h4> <a HREF="#NewtonBodySetContinuousCollisionMode">NewtonBodySetContinuousCollisionMode</a>


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonMaterialSetDefaultFriction"></a>
<a NAME="NewtonMaterialSetDefaultFriction"></a>
NewtonMaterialSetDefaultFriction
</h3>
<div class=Api>
void <font class=ApiName>NewtonMaterialSetDefaultFriction</font>(<br> const NewtonWorld* newtonWorld,<br> int id0,<br> int id1,<br> dFloat staticFriction,<br> dFloat kineticFriction)
</div>
<div class=SectionText>
Set the default coefficients of friction for the material defined by the interaction between two physics groups.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>const NewtonWorld</b> *newtonWorld
</td>
<td class=DefSep>-</td>
<td class=DefText>
is the pointer to the Newton world
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>dFloat</b> staticFriction
</td>
<td class=DefSep>-</td>
<td class=DefText>
	static friction coefients
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>dFloat</b> kineticFriction
</td>
<td class=DefSep>-</td>
<td class=DefText>
dynamic coefficient of friction
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> <b>staticFriction</b> and <b>kineticFriction</b> must be positive values. <b>kineticFriction</b> must be lower than <b>staticFriction</b>.
   It is recommended that <b>staticFriction</b> and <b>kineticFriction</b> be set to a value lower or equal to 1.0, however because some synthetic materials
   can have higher than one coeficient of friction Newton allows for the coeficient of friction to be as high as 2.0.


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonMaterialSetDefaultElasticity"></a>
<a NAME="NewtonMaterialSetDefaultElasticity"></a>
NewtonMaterialSetDefaultElasticity
</h3>
<div class=Api>
void <font class=ApiName>NewtonMaterialSetDefaultElasticity</font>(<br> const NewtonWorld* newtonWorld,<br> int id0,<br> int id1,<br> dFloat elasticCoef)
</div>
<div class=SectionText>
Set the default coefficients of restitution (elasticity) for the material defined by the interaction between two physics groups.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>const NewtonWorld</b> *newtonWorld
</td>
<td class=DefSep>-</td>
<td class=DefText>
is the pointer to the Newton world
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>dFloat</b> elasticCoef
</td>
<td class=DefSep>-</td>
<td class=DefText>
static friction coefficients
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> <b>elasticCoef</b> must be a positive value. 
   It is recommended that <b>elasticCoef</b> be set to a value lower or equal to 1.0


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonMaterialSetDefaultSoftness"></a>
<a NAME="NewtonMaterialSetDefaultSoftness"></a>
NewtonMaterialSetDefaultSoftness
</h3>
<div class=Api>
void <font class=ApiName>NewtonMaterialSetDefaultSoftness</font>(<br> const NewtonWorld* newtonWorld,<br> int id0,<br> int id1,<br> dFloat softnessCoef)
</div>
<div class=SectionText>
Set the default softness coefficients for the material defined by the interaction between two physics groups.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>const NewtonWorld</b> *newtonWorld
</td>
<td class=DefSep>-</td>
<td class=DefText>
is the pointer to the Newton world
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>dFloat</b> softnessCoef
</td>
<td class=DefSep>-</td>
<td class=DefText>
softness coefficient
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> <b>softnessCoef</b> must be a positive value. 
   It is recommended that <b>softnessCoef</b> be set to value lower or equal to 1.0
   A low value for <b>softnessCoef</b> will make the material soft. A typical value for <b>softnessCoef</b> is 0.15


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonMaterialSetCollisionCallback"></a>
<a NAME="NewtonMaterialSetCollisionCallback"></a>
NewtonMaterialSetCollisionCallback
</h3>
<div class=Api>
void <font class=ApiName>NewtonMaterialSetCollisionCallback</font>(<br> const NewtonWorld* newtonWorld,<br> 
	int id0,<br> 
	int id1,<br> 
	void *userData,<br>
	NewtonContactBegin beginCallback,<br> 
	NewtonContactProcess processCallback,<br> 
	NewtonContactEnd endCallback)
</div>
<div class=SectionText>
Set userData and the functions event handlers for the material defined by the interaction between two physics groups.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>const NewtonWorld</b> *newtonWorld
</td>
<td class=DefSep>-</td>
<td class=DefText>
is the pointer to the Newton world.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>void</b> *userData
</td>
<td class=DefSep>-</td>
<td class=DefText>
user data value.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>NewtonContactBegin</b> beginCallback
</td>
<td class=DefSep>-</td>
<td class=DefText>
address of the event function called before contact calculation for collision. This parameter can be NULL.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>NewtonContactProcess</b> processCallback
</td>
<td class=DefSep>-</td>
<td class=DefText>
address of the event function called for every contact resulting from contact calculation. This parameter can be NULL.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>NewtonContactEnd</b> endCallback
</td>
<td class=DefSep>-</td>
<td class=DefText>
address of the event function called after all contacts are processed. This parameter can be NULL.
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> When the AABB extend of the collision geometry of two bodies overlap, Newton collision system retrieves the material 
   interaction that defines the behavior between the pair of bodies. The material interaction is collected from a database of materials, 
    indexed by the material gruopID assigned to the bodies. If the material is tagged as non collidable, 
   then no action is taken and the simulation continues. 
   If the material is tagged as collidable, and a <b>beginCallback</b> was set for this material, then the <b>beginCallback</b> function is called. 
   If the function  *beginCallback* returns 0, no further action is taken for this material (this can be use to ignore the interaction under 
   certain conditions). If the function  *beginCallback* returns 1, Newton proceeds to calculate the array of contacts for the pair of 
   colliding bodies. If the function <b>processCallback</b> was set, the application receives a callback for every contact found between the 
   two colliding bodies. Here the application can perform fine grain control over the behavior of the collision system. For example, 
   rejecting the contact, making the contact frictionless, applying special effects to the surface etc. 
   After all contacts are processed and if the function <b>endCallback</b> was set, Newton calls <b>endCallback</b>. 
   Here the application can collect information gathered during the contact-processing phase and provide some feedback to the player. 
   A typical use for the material callback is to play sound effects. The application passes the address of structure in the <b>userData</b> along with 
   three event function callbacks. When the function <b>beginCallback</b> is called by Newton, the application resets a variable say <b>maximumImpactSpeed</b>. 
   Then for every call to the function <b>processCallback</b>, the application compares the impact speed for this contact with the value of 
   <b>maximumImpactSpeed</b>, if the value is larger, then the application stores the new value along with the position, and any other quantity desired. 
   When the application receives the call to <b>endCallback</b> the application plays a 3d sound based in the position and strength of the contact.


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonMaterialGetUserData"></a>
<a NAME="NewtonMaterialGetUserData"></a>
NewtonMaterialGetUserData
</h3>
<div class=SectionText>
Get userData associated with this material.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>const NewtonWorld</b> *newtonWorld
</td>
<td class=DefSep>-</td>
<td class=DefText>
is the pointer to the Newton world.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id0
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id0.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>int</b> id1
</td>
<td class=DefSep>-</td>
<td class=DefText>
group id1.
</td>
</tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -