Difference between revisions of "Mirror"

From Serious Sam Wiki
Jump to: navigation, search
m (Forgot about "Incomplete" category =P)
(Other Information: Renamed section, rewritten weird tutorial)
 
Line 27: Line 27:
 
{{E_ReceiveDamage|Mirror}}
 
{{E_ReceiveDamage|Mirror}}
  
== Other Information ==
+
== Setting up a simple mirror ==
Texture for reflection and refraction properties should be copied from model's pre-made [[Shader Modifiers|shader modifier]] (only CCanvasTexture is allowed).
+
  
* 1. Enter model's shader modifiers.
+
To set up a simple working mirror:
* 2. Create new CConstantShaderModifier.
+
 
* 3. In Value tab select CShaderArgValTexture.
+
* 1. Create a model and set a 'Ripple' shader for it.  
* 4. In Pointer create new CCanvasTexture.
+
* 2. Create a Mirror entity and place it over your model.
* 5. In Destination set "refraction texture" or "reflection texture".
+
* 3. In Mirror's entity on 'reflection texture' field click '(none)', then select 'New' => 'CCanvasTexture'.
* 6. In model's [[Edit Mesh Data|edit mesh]] you should have one ripple shader configuration (you don't need to set up reflection or refraction textures here).
+
* 4. Select the newly made field and press Ctrl+C.
 +
* 5. Select your model, expand 'Shader modifiers' field and create a new 'CConstantShaderModifier'.
 +
* 6. In its Value create new 'CShaderArgValTexure'. Then click 'Pointer' field and press Ctrl+V.
 +
* 7. In 'Destination' field type 'reflection texture'.
 +
 
 +
This should make a working mirror for you.
  
 
== Related Pages and Links ==
 
== Related Pages and Links ==

Latest revision as of 11:04, 25 October 2019

Editor model of CMirrorEntity.

General information

Class: CMirrorEntity

The Mirror is an entity used to make refraction and reflection on models.

Properties

Reflection (CCanvasTexture)

Texture used for reflection rendering. For more information see Shader Modifiers.


Refraction (CCanvasTexture)

Texture used for refraction rendering. For more information see Shader Modifiers.


Portal marker (CPortalMarkerProperties)

To do: Add description


Custom visibility sectors (CString)

Defines sectors in which reflection/refraction is visible.


Max distance (FLOAT)

Defines the maximum possible distance from which the player is able to see reflection/refraction.


Mirror levels per platform (CStaticStackArray)

Contains mirror levels for each platform, i.e. what will be visible in mirrors.


Spawn flags (LFLAGS)

Defines in which difficulty levels and game types the Mirror is spawned.


Name (CString)

Defines the name of the Mirror.


Defines a entity pointer to the parent of the Mirror.


Platforms (LFLAGS)

Defines on which platforms the Mirror is spawned.


Entity ID (ULONG)

Displays the entity ID of the Mirror.


Info 16x16.png Note: Entity ID cannot be edited.

Script Functions

Methods

Info 16x16.png Note: CMirrorEntity does not have native methods.

CBaseEntity Methods
Name Parameters Return Data Type Description
Name Data Type
ApplyDamageTool
SEd3.5 or higher
DamageSource CString void To do: Add description
DamageType CString
WeaponIndex WeaponIndex
CharacterClass IDENT
Damage SLONG
EnableReceiveDamageScriptEvent
SEd3.5 or higher
- void Enables ReceiveDamage script events (see below).
Warning 16x16.png Warning: This function disables native damage handling.
EnableTouchAutoMoveTarget
SEd4.0 only
Enabled BOOL void Enables the entity to become an auto move target.
GetAngularVelocity - Vector3f Returns angular velocity of the entity in Vector3f format.
GetAttachmentAbsolutePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to World Spawn in QuatVect format.
GetAttachmentRelativePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to entity in QuatVect format.
GetClassName
SEd3.5 or higher
- CString Returns classname in CString format.
GetLinearVelocity - Vector3f Returns linear velocity of entity in Vector3f format.
GetName - CString Returns the name of the entity in CString format.
GetParent Name IDENT Handle Returns a CBaseEntity handle of the parent of the entity.
GetPlacement - QuatVect Returns position and orientation of the entity in QuatVect format.
GetWorld
SEd3.5 or higher
- CWorld* To do: Add description
GetWorldInfo
SEd3.5 or higher
- CWorldInfoEntity* To do: Add description
InflictDamage Amount SLONG void Inflicts damage to entity.
InflictDamageOfType Amount SLONG void Inflicts damage of a specified damage type to entity.
DamageType CString
InflictDamageToTarget
SEd3.5 or higher
Target Handle void To do: Add description
Amount SLONG
Weapon IDENT
DamageType CString
InflictWeaponDamage
SEd3.5 only
Amount SLONG void To do: Add description
Weapon IDENT
DamageType CString
IsDestroyed - BOOL Returns 1 if entity is destroyed.
IsReceiveDamageScriptEventEnabled
SEd3.5 or higher
- BOOL Returns 1 if ReceiveDamageScriptEvent is enabled (see above).
SetAngularVelocity AngVelocity Vector3f void Sets angular velocity of entity to the specified Vector3f value.
SetLinearVelocity Velocity Vector3f void Sets the velocity of the entity to the specifed Vector3f values.
SetPlacement Placement QuatVect void Sets position and orientation of the entity to the specified QuatVect values.

Events

Destroyed
Triggers when the Mirror is destroyed.
EntityDeleted → SEd3.5 or higher
Triggers when the Mirror is deleted.
ReceiveDamage → SEd3.5 or higher
Triggers when the Mirror receives damage.
Info 16x16.png Note: This event requires enabling via EnableReceiveDamageScriptEvent method.

Setting up a simple mirror

To set up a simple working mirror:

  • 1. Create a model and set a 'Ripple' shader for it.
  • 2. Create a Mirror entity and place it over your model.
  • 3. In Mirror's entity on 'reflection texture' field click '(none)', then select 'New' => 'CCanvasTexture'.
  • 4. Select the newly made field and press Ctrl+C.
  • 5. Select your model, expand 'Shader modifiers' field and create a new 'CConstantShaderModifier'.
  • 6. In its Value create new 'CShaderArgValTexure'. Then click 'Pointer' field and press Ctrl+V.
  • 7. In 'Destination' field type 'reflection texture'.

This should make a working mirror for you.

Related Pages and Links