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

📄 newton.htm

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

<!-- Page generated by TwinText - PTLogica -->

<html>
<head>
<title>
Newton Game Dynamics 1.5
</title>

<style type="text/css">

<!--
/*  TwinText Style (c) PTLogica 2002 - 2003  */

 
/* Body */
body{font-family:"Verdana", sans-serif;font-size: 8pt; }

/* Body (Chapter) */
body.Main{background: #FFFFFF;color: #000000;  margin: 0; }

/*IE 5.5 */
li, table {  font-family: "Verdana", sans-serif; font-size: 8pt;  }

/* Project Title */
div.ProjectTitle {
	font-style: italic;
	font-size: 8pt;
	font-weight: normal;
	color: White;
	text-align: left;
}

/* Chapter's Title */
h1{font-family:"Verdana", sans-serif;font-size: 10pt;
font-weight: bold;text-align: left;margin-left: 0pt;margin-right: 0pt;margin-top: 0px;margin-bottom: 15px; padding-top: 5px;  padding-bottom: 5px;  padding-left: 10px;  background-color: #FFA500;  color: White;
                                                                                                                                                                                                                                                                                                            border-bottom: 1px solid #999999;
                                                                                                                                                                                                                                                                                          }

/* Common to all section text, including first section */
div.SectionText{margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;         }

/* Contents or Summary */
h2{font-family:"Verdana", sans-serif;font-size: 9pt;font-weight: bold;text-align: left;margin-left: 5px;margin-right: 0pt;margin-top: 5pt;margin-bottom: 2pt;    padding-top: 5px;    padding-bottom: 5px;             }

/* Table of Contents */
div.Toc{margin-top: 30px;margin-bottom: 30px;    padding: 5px;  margin-left: 30px;  margin-right: 30px;    }
div.TocLinks{font-weight: normal;text-align: left;margin-left: 0pt;margin-right: 0pt;margin-top: 0pt;margin-bottom: 0pt;}
ul.TocLinks{}
li.TocLink{}
a.TocLink:link{text-decoration: underline;color: blue;background: transparent;  font-weight: normal; }
a.TocLink:visited{text-decoration: underline;color: blue;background: transparent; font-weight: normal;}
a.TocLink:hover{text-decoration: underline;color: #0066FF;background: transparent; font-weight: normal;}


/* Summary */
div.Summary{margin-top: 20px;margin-bottom: 40px;    padding: 5px;  margin-left: 20px;  margin-right: 20px; }
table.SummaryTable{ margin-top: 10px;  margin-bottom: 15px;  background-color: White;      }
tr.SummaryRow {  }
td.SummaryLink{font-weight: normal;text-align: left;width: 15%;        padding: 3px;  background: White;  vertical-align: top;             }
td.SummaryText{text-align: left;      padding: 3px;  background-color: transparent;  background: #F1F1F1;  vertical-align: top;           }
a.SummaryLink:link{text-decoration: underline;color: blue;background: transparent;  font-weight: normal; }
a.SummaryLink:visited{text-decoration: underline;color: blue;background: transparent; font-weight: normal;}
a.SummaryLink:hover{text-decoration: underline;color: #0066FF;background: transparent; font-weight: normal;}


/* Sections */
div.AllSections{margin-top: 0;margin-bottom: 70px;  margin-left: 0;  margin-right: 0;  padding: 0px;   }

div.Section{margin-top: 30px;margin-bottom: 10px;}
h3{font-family:"Verdana", sans-serif;font-size: 9pt;font-weight: bold;text-align: left;margin-left: 0pt;margin-right: 0pt;margin-top: 5pt;margin-bottom: 10px;border-bottom: 1px solid #FFA500;  padding-left: 10px;  padding-bottom: 2px;  background: transparent;  padding-top: 3px;       }

/* API Box */
div.Api{font-family:"Courier New", monospace;font-size: 8pt;margin-left: 15px;margin-right: 15px;margin-top: 15px;margin-bottom: 15px;padding: 2px;background: #F1F1F1;color: #000000;  border: 1px solid #999999;    }
font.ApiName{font-weight: bold;}

/* Section Text Elements */
h4{font-family:"Verdana", sans-serif;font-size: 8pt;font-weight: bold;margin-left: 0pt;margin-right: 0pt;margin-top: 5pt;margin-bottom: 2pt;  font-style: normal;       }
pre{font-family:"Courier New", monospace;font-size: 8pt;white-space: pre;margin-top: 7pt;margin-bottom: 7pt;color: #000000;    padding: 5px;  margin-left: 5px;  margin-right: 5px;  background: #F1F1F1;        }
font.HighText{background: #FFFFE1;   }
ul{}
li{list-style: disc;}
a:link{text-decoration: underline;color: #0000FF;background: transparent;}
a:visited{text-decoration: underline;color: #0000FF;background: transparent;}
a:hover{text-decoration:underline;color: #0066FF;background: transparent;}
	
/* Definitions Table */
table.DefTable{ margin-left: 20px;  margin-right: 20px;   }
tr.Def{  }
td.Def{font-family:"Courier New", monospace;font-size: 8pt;  font-weight: normal;  padding-left: 5px;  padding-right: 5px;  white-space: nowrap;  text-align: left;  vertical-align: top;  background: transparent;  margin: 2px;              }
td.DefSep{font-family:"Courier New", monospace;font-size: 8pt;padding-right: 5pt;padding-left: 5pt;  text-align: center;  vertical-align: top;  background: transparent;   }
td.DefText{ text-align: left;  vertical-align: top;  background: transparent;  margin: 2px;       }

/* Copyright */
div.Copy { padding: 15px;  }

/* Footer */
div.Footer{   margin-top: 10px;  padding: 5px;    background: #FFA500;  border-top: 1px solid #999999;   color: White;         }

div.SourceLocation{background: transparent;  font-size: 8pt;  margin-bottom: 10px;  margin-left: 10px;  font-family: Verdana, sans-serif;    }
div.LastGenerated{background: transparent;  font-size: 8pt;  margin-left: 10px;  font-family: Verdana, sans-serif;   }


/* Navigation */
body.Side{background: #F1F1F1;color: Black;  margin: 0px;  padding: 0px;  }
div.Side{}
div.SideTitle{ font-weight: bold;  padding: 3px 10px;  font-size: 10pt;  font-family: Verdana, sans-serif;  margin-top: 2px;        }
div.SideText{ padding: 10px; padding-top: 18px;  }
div.SideDetail {  padding-top: 1px; }
ul.SideDetail{ }
li.SideDetail{ }
a.SideDetail:link { text-decoration: underline; color: Blue; font-family: Verdana, sans-serif; font-size: 8pt;  font-weight: normal;      }
a.SideDetail:visited {  text-decoration: underline; color: Blue; font-family: Verdana, sans-serif; font-size: 8pt;  font-weight: normal;  }
a.SideDetail:hover {  text-decoration: underline; color: #0066FF; font-family: Verdana, sans-serif; font-size: 8pt;  font-weight: normal;  }

table.LinksTable{ padding-left: 10px; }
tr.SideLink{}
td.SideLink{}
a.SideLink:link { text-decoration: underline; color:Blue; font-family: Verdana, sans-serif; font-size: 8pt;  }
a.SideLink:visited {  text-decoration: underline; color: Blue; font-family: Verdana, sans-serif; font-size: 8pt; }
a.SideLink:hover {  text-decoration: underline; color: #0066FF; font-family: Verdana, sans-serif; font-size: 8pt;  }










-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="TwinText">

</head>
<body class=Main>
<h1>
Newton Game Dynamics 1.5
</h1>
<div class=SectionText>
   Advanced physics engine for real-time simulation of rigid bodies.
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
Created by Julio Jerez 2003
</td>
<td class=DefSep>-</td>
<td class=DefText>
2005. All rights reserved.
</td>
</tr>
</table>

<p>
                                                                                                    
</div>
<div class=AllSections>
<div class=Section>
<h3>
<a NAME="World^interface"></a>
<a NAME="World interface"></a>
World interface
</h3>
<div class=SectionText>

                                                                                                                  
<p>

</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonCreate"></a>
<a NAME="NewtonCreate"></a>
NewtonCreate
</h3>
<div class=Api>
NewtonWorld* <font class=ApiName>NewtonCreate</font>(<br> NewtonAllocMemory mallocFnt,<br> NewtonFreeMemory mfreeFnt)
</div>
<div class=SectionText>
Create an instance of the Newton world.
  
<p>   <h4>Parameters</h4>
   
<p><table class=DefTable>
<tr class=Def>
<td class=Def>
<b>NewtonAllocMemory</b> mallocFnt
</td>
<td class=DefSep>-</td>
<td class=DefText>
	is a pointer to the memory allocator callback function. If this parameter is 
  									NULL the standard <b>malloc</b> function is used.
</td>
</tr>

<p>   
<tr class=Def>
<td class=Def>
<b>NewtonFreeMemory</b> mfreeFnt
</td>
<td class=DefSep>-</td>
<td class=DefText>
	is a pointer to the memory release callback function. If this parameter is NULL
  									the standard <b>free</b> function is used.
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> a pointer to an instance of the Newton world.
  
<p>   <h4>Remarks</h4> this function must be called before any of the other API functions.
  
<p>  
   <h4>See also</h4> <a HREF="#NewtonDestroy">NewtonDestroy</a>, <a HREF="#NewtonDestroyAllBodies">NewtonDestroyAllBodies</a>


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonDestroy"></a>
<a NAME="NewtonDestroy"></a>
NewtonDestroy
</h3>
<div class=Api>
void <font class=ApiName>NewtonDestroy</font>(const NewtonWorld* newtonWorld)
</div>
<div class=SectionText>
Destroy an instance of the Newton world.
  
<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>
</table>

<p>   
   <h4>Return</h4> Nothing.
  
<p>   <h4>Remarks</h4> This function will destroy the entire Newton world.
  
<p>   <h4>See also</h4> <a HREF="#NewtonCreate">NewtonCreate</a>, <a HREF="#NewtonDestroyAllBodies">NewtonDestroyAllBodies</a>


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonGetGlobalScale"></a>
<a NAME="NewtonGetGlobalScale"></a>
NewtonGetGlobalScale
</h3>
<div class=Api>
dFloat <font class=ApiName>NewtonGetGlobalScale</font>(const NewtonWorld* newtonWorld)
</div>
<div class=SectionText>
Get the global scale factor.
   
<p>   <h4>Remarks</h4> the physics system in theory should be dimensionless, however in practice the engine have to be implemented with
   limited precision floating numbers and is also built for real-time simulation, it is inevitable that tolerances have to be used in order to increase performance, and 
   reduce instabilities. These tolerances make the engine dimension dependent, for example let say a rigid body is considered at rest when 
   its velocity is less than 0.01 units per second for some frames. For a program using meters as unit this translate to 0.01 meters per second, 
   however for a program using centimeter this translate to 0.0001 meter per second, since the precession of speed is independent of the unit system, 
   this means that in the second system the engine has to work much harder to bring the body to rest. A solution for this is to scale all tolerances 
   to match the unit system. The argument <b>globalScale</b> must be a constant to convert the unit system in the game to meters, for example if in your game you are using 39 units is a meter, 
   the <b>globaScale</b> must be 39. The exact conversion factor does not have to be exact, but the closer it is to reality the better performance the application will get.
   Applications that are already using meters as the unit system must pass 1.0 as <b>globalScale</b>.
  
<p>  <h4>See also</h4> <a HREF="#NewtonCreate">NewtonCreate</a>
  dFloat NewtonGetGlobalScale(const NewtonWorld* newtonWorld)
  {
  	Newton *world;
  	world = (Newton *) newtonWorld;
  	return world->GetGlobalScale();
  	return dgFloat32(1.0f);
  }


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonSetPlatformArchitecture"></a>
<a NAME="NewtonSetPlatformArchitecture"></a>
NewtonSetPlatformArchitecture
</h3>
<div class=Api>
void <font class=ApiName>NewtonSetPlatformArchitecture</font>(<br> const NewtonWorld* newtonWorld,<br> int mode)
</div>
<div class=SectionText>
Set the current platform hardware architecture.
  
<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> model
</td>
<td class=DefSep>-</td>
<td class=DefText>
model of operation 0 = default, 1 = medium, n = best.
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing
  
<p>   <h4>Remarks</h4> This function allows the application to configure the Newton to take advantage  
   for specific hardware architecture in the same platform.
  
<p>   <h4>0</h4> force the hardware lower common denominator for the running platform.
  
<p>   <h4>1</h4> will try to use common floating point enhancement like spacial instruction set 
   on the specific architecture. This mode made lead to result that differ from mode 1 and 2 as the accumulation 
   round off errors maybe different. 
  
<p>   <h4>2</h4> the engine will try to use the best possible hardware setting found in the current platform 
   this is the default configuration. This mode made lead to result that differ from mode 1 and 2 as the accumulation 
   round off errors maybe different. 
  
<p>   <h4>Remarks</h4> the only hardware mode guarantee to work is mode 0. all other are only 
   hints to the engine, for example setting mode 1 will take not effect on CPUs without  
   specially floating point instructions set. 


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonSetSolverModel"></a>
<a NAME="NewtonSetSolverModel"></a>
NewtonSetSolverModel
</h3>
<div class=Api>
void <font class=ApiName>NewtonSetSolverModel</font>(<br> const NewtonWorld* newtonWorld,<br> int model)
</div>
<div class=SectionText>
Set the solver precision mode.
  
<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> model
</td>
<td class=DefSep>-</td>
<td class=DefText>
model of operation 0 = exact, 1 = adaptive, n = linear. The default is exact.
</td>
</tr>
</table>

<p>   
   <h4>Return</h4> Nothing
  
<p>   <h4>Remarks</h4> This function allows the application to configure the Newton solver to work in three different modes.  
  
<p>   <h4>0</h4> Is the exact mode. This is good for application where precision is more important than speed, ex: realistic simulation.
  
<p>   <h4>1</h4> Is the adaptive mode, the solver is not as exact but the simulation will still maintain a high degree of accuracy. 
   This mode is good for applications were a good degree of stability is important but not as important as speed. 
  
<p>   <h4>n</h4> Linear mode. The solver will not try to reduce the joints relative acceleration errors to below some limit, 
   instead it will perform up to n passes over the joint configuration each time reducing the acceleration error, 
   but it will terminate when the number of passes is exhausted regardless of the error magnitude. 
   In general this is the fastest mode and is is good for applications where speed is the only important factor, ex: video games.
  
<p>   <h4>Remarks</h4> the adaptive friction model combined with the linear model make for the fastest possible configuration 
   of the Newton solver. This setup is best for games.
   If you need the best realistic behavior, we recommend the use of the exact solver and exact friction model which are the defaults.
  
<p>   <h4>See also</h4> <a HREF="#NewtonSetFrictionModel">NewtonSetFrictionModel</a>


</div>
</div>
<div class=Section>
<h3>
<a NAME="NewtonSetFrictionModel"></a>
<a NAME="NewtonSetFrictionModel"></a>
NewtonSetFrictionModel
</h3>
<div class=Api>
void <font class=ApiName>NewtonSetFrictionModel</font>(<br> const NewtonWorld* newtonWorld,<br> int model)
</div>
<div class=SectionText>
Set coulomb model of friction.
  
<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> model
</td>
<td class=DefSep>-</td>

⌨️ 快捷键说明

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