- Panda3d 1.7 Game Developer's Cookbook
- Christoph Lang
- 473字
- 2021-04-09 21:21:43
Understanding Panda3D's runtime configuration options
Panda3D allows you to configure the engine runtime using a central configuration file. This recipe will show you where to find this configuration file and will explain a selection of settings you are able to specify to tweak Panda3D's behavior.
How to do it...
You can configure the Panda3D engine with these two steps:
- Open the file
C:\Panda3D-1.7.0\etc\Config.prc
in a text editor. - Edit and add settings.
How it works...
Now that you've opened Panda3D's configuration file, it is time to explain a good part of the vast array of settings the engine allows you to modify. The following table will present the names of the configuration variables, the values that can be set, as well as a short description of what part of Panda3D is influenced by the setting.
The column containing the possible values uses several notations:
- Square brackets are used to denote an interval of values. For example, [0..8] denotes an interval of integers between 0 and 8, while the notation [0.0..1.0] stands for an interval of floating point values. The interval boundaries are inclusive.
- Within intervals, the labels
MAX_INT
andMAX_DBL
are used as placeholders for the maximum possible values for signed integer and floating point variables. - The
prc
file format uses#t
for true and#f
for false for Boolean configuration flags. For example, the following line inConfig.prc
enables full screen mode:fullscreen #t
- "A valid file path" means a Unix-style file path, even on Windows. For example, the following line is used to set the application icon:
icon-filename /c/mygame/assets/icon.ico
- Any other values than the ones previously described are meant to be inserted directly, without quotes. If multiple values are listed, you may use one of them at a time.


There's more...
By setting the configuration variables above, you are already able to modify the engine's runtime behavior to your liking. But Panda3D's configuration system provides a few additional features you should know about.
Listing all configuration variables
The preceding table only shows a selection of the most commonly used configuration variables. To get a list of all configuration variables available in Panda3D, insert the following import statement and method call into your application code:
from panda3d.core import ConfigVariableManager ConfigVariableManager.getGlobalPtr().listVariables()
Loading a specific configuration file
You do not need to put all engine settings into the global configuration file shown in this recipe. Instead, you can use the following function to load settings from any given file:
loadPrcFile("myconfig.prc")
You should put this call to a global scope to make sure settings are loaded before the engine systems that are using them are initialized.
- OpenStack實(shí)戰(zhàn)指南
- Software Testing using Visual Studio 2010
- 中文版Illustrator CC基礎(chǔ)培訓(xùn)教程(移動(dòng)學(xué)習(xí)版)
- Word 2010實(shí)戰(zhàn)技巧精粹
- Joomla! Social Networking with JomSocial
- 中文版Photoshop CS6平面設(shè)計(jì)實(shí)例教程(第2版)
- BIRT 2.6 Data Analysis and Reporting
- Indesign平面排版技術(shù)應(yīng)用
- Origin 2022科學(xué)繪圖與數(shù)據(jù)分析(高級(jí)應(yīng)用篇)
- 剪映專業(yè)版:短視頻創(chuàng)作案例教程(全彩慕課版)
- UG NX 12.0中文版自學(xué)視頻教程
- Photoshop+PxCook+Cutterman網(wǎng)頁UI設(shè)計(jì)教程
- Adobe Camera Raw完全自學(xué)教程
- 深度學(xué)習(xí)圖像識(shí)別技術(shù):基于TensorFlow Object Detection API和OpenVINO? 工具套件
- 中文版CorelDRAW圖形創(chuàng)意設(shè)計(jì)與制作全視頻實(shí)戰(zhàn)228例