Skip to content

Commit

Permalink
Corrections in the zCVob article
Browse files Browse the repository at this point in the history
  • Loading branch information
muczc1wek committed Feb 6, 2024
1 parent 5050d01 commit 151236c
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions docs/zengin/worlds/Classes/zCVob.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# zCVob

**zCVob** is a base class for all objects placed in a world.

!!! example "Acknowledgment"
Heavily inspired by the amazing documentation site [Gothic library](http://www.gothic-library.ru/publ/class_zcvob/1-1-0-467)
Represents so-called virtual objects which appear in the game world. `zCVob` is the base class for all virtual objects which include everything from static models like boxes to interactive elements like doors and chests and invisible trigger objects.

## Class members

Expand Down Expand Up @@ -67,40 +64,41 @@
## Class member overview

### pack
No Information provided.
Internal property which indicates how the data associated with this virtual object is stored.

### presetName
The name of the template that was used to create the item.
The name of the template that was used to create this virtual object.

### bbox3DWS
Volume of virtual object. Defined by two opposite diagonal points of the BoundingBox (`1x, 1y, 1z`, `2x, 2y, 2z`). The volume is needed to calculate collisions and interactions with other game objects. For example, with dynamic objects, which include characters (class C_NPC), items (class [C_ITEM](../../scripts/classes/c_item.md) ), etc.
The 3-dimensional bounding box of this virtual object. Defined by two opposite diagonal points (`1x, 1y, 1z`, `2x, 2y, 2z`). This is used in conjunction with [cdStatic](#cdstatic) and [cdDyn](#cddyn) calculate collisions and interactions with other game objects (NPCs, items, etc.).

Interaction processing begins when object volumes intersect. For example, when the player enters the world change trigger area, the engine loads another game level based on the parameters this trigger. All this happens when the main character's BoundingBox intersects with the trigger's BoundingBox.

The BoundingBox can only be changed using the `Edit the Bbox` button in Spcaer.

### trafoOSToWSRot
Orientation relative to the coordinate center.
The rotation of this virtual object in world space, represented by a 3x3 rotation matrix.

!!! Note
This refers to the center of coordinates of the `.3DS` file of the game world on which the `ZEN` file is built.

### trafoOSToWSPos
Coordinates of the position in space relative to the center of coordinates.
Coordinates of the object in world space relative to the center.

!!! Note
This refers to the center of coordinates of the `.3DS` file of the game world on which the `ZEN` file is built.

The coordinates are set automatically the first time an instance of the class is inserted into the game world. You can change them either directly by entering numerical values ​​in the corresponding fields of the parameter, by [moving the vob](../spacer.md#viewport-controls) in spacer.

### vobName
An identifier of a zCVob shown in the editor and sometimes used in scripts. The name can be left blank.

For some object classes, entering a name is required: zCVobSpot , zCVobWaypoint , zCTrigger , etc.
For some object classes, entering a name is required: zCVobSpot, zCVobWaypoint, zCTrigger etc.

!!! Danger
Setting a name for every static and insignificant object can lead to an error when parsing the game world.
### visual
The name of the file that will be responsible for the visual display of the object.
The name of the visual component associated with this object, usually a name of a file.

Different file formats are used for different object classes:
Following formats are suppoted:

- `*.3DS` - Static objects
- `*.PFX` - Particle effects
Expand All @@ -110,7 +108,7 @@ Different file formats are used for different object classes:


### showVisual
This option is responsible for displaying the object.
Indicates whether this object should display its visual.

**Accepted values:**

Expand All @@ -128,7 +126,7 @@ Option to align objects relative to the camera.
- **FULL** - The object is aligned relative to the world axes.

!!! Note
For example, in order for the grass model to always face the character, you need to set this parameter to **YAW**.
This may be used with grass or flowers which only consist of a 2-dimensional sprite to have it always face the camera.

### visualAniMode
Wind simulation option. Used in conjunction with the [visualAniModeStrength](#visualanimodestrength) parameter.
Expand All @@ -140,42 +138,42 @@ Wind simulation option. Used in conjunction with the [visualAniModeStrength](#vi
- **WIND2** - Light wind effect. Acceptable for trees.

!!! Warning
This option is only available in Gothic 2 (Spacer2).
This option is only available in Gothic II (Spacer2).

### visualAniModeStrength
Wind power animation multiplier. Small values such as `0.001` are typically used. Used in conjunction with the [visualAniMode](#visualanimode) parameter.

!!! Warning
This option is only available in Gothic 2 (Spacer2).
This option is only available in Gothic II (Spacer2).

### vobFarClipZScale
Sets the loading range of the VOB object. Depends on the VOB drawing distance specified using the `zCZoneVobFarPlane` object.

The range of values is from `0.0` to `2.0`.

With a value of `0.0`, the object is not visible, but collisions are calculated. With a value of `2.0`, the VOB drawing range is identical to the VOB drawing range of objects specified by the `zCZoneVobFarPlane` object.
With a value of `0.0`, the object is not visible, but collisions are calculated. With a value of `2.0`, the `zCVob` drawing range is the same as the draw distance specified in `zCZoneVobFarPlane` object.

!!! Warning
This option is only available in Gothic 2 (Spacer2).
This option is only available in Gothic II (Spacer2).

### CdStatic
Determines if the VOB will collide with the static objects (world mesh and other VOBs with **cdStatic** on).
Determines if the virtual object will collide with the static objects (world mesh and other VOBs with **cdStatic** on).

**Accepted values:**

- TRUE - Collision handling for static objects is enabled.
- FALSE - Collision handling for static objects is disabled.
- TRUE - Collide with static objects.
- FALSE - Don't collide static objects.

!!! Tip
A situation often arises when objects “refuse” to move beyond a certain point on the surface. This happens when **cdStatic** is set to **TRUE**, i.e. the object cannot cross the surface another static object. In this case, it is enough to disable the **cdStatic** parameter for the duration of the move, and turn it on again after the move.

### CdDyn
Determines if the VOB will collide with dynamic objects (NPCs, items, etc.). This basically determines if the object has collision during gameplay.
Determines if the virtual object will collide with dynamic objects (NPCs, items, etc.). This basically determines if the object has collision during gameplay.

**Accepted values:**

- **TRUE** - Collision handling for dynamic objects is enabled.
- **FALSE** - Collision handling for dynamic objects is disabled.
- **TRUE** - Collide with dynamic objects.
- **FALSE** - Don't collide with dynamic objects.


### staticVob
Expand All @@ -190,26 +188,29 @@ Determines if the VOB is taken into consideration in static lighting calculation
The shadow is calculated when compiling light in Low, Middle or High mode.

### dynShadow
Determine if the object will cast a shadow when affected by dynamic light (e.g. torches).
Indicates whether the object will cast a shadow when affected by dynamic light (e.g. torches).

**Accepted values:**

- **DS_NONE** - No shadow.
- **DS_BLOB** - Casts a circular shadow.

### zbias
Option to remove texture flickering if a `.TGA` file is used as rendering.
The depth-bias for this virtual object.

Can be used remove texture flickering if a `.TGA` file is used as rendering.

!!! Warning
This option is only available in Gothic 2 (Spacer2).
This option is only available in Gothic II (Spacer2).

### isAmbient
Sets the calculation of refracted lighting of objects.
Indicates that this virtual object is ambient. It looks like this setting was a system used during development when access to the game's source code was available. Basically, the global variable `zCWorld::s_bAmbientVobsEnabled` could be used to hide or show virtual objects which have the `isAmbient` flag set. In release builds, this variable is always set to true, thus the `isAmbient` flag does not have any perceivable effect on the game. It follows, that this field should be ignored by most implementations.

**Accepted values:**
!!! Warning
This option is only available in Gothic II (Spacer2).

- TRUE - Calculate the refraction of light.
- FALSE - Do not calculate light refraction.
[^1]:
Heavily inspired by the zCVob article at [gothic-library](http://www.gothic-library.ru/publ/class_zcvob/1-1-0-467).

!!! Warning
This option is only available in Gothic 2 (Spacer2).
[^2]:
Corrected with information found in [ZenKit ZenGin Reference](https://zk.gothickit.dev/engine/objects/zCVob/).

0 comments on commit 151236c

Please sign in to comment.