Structs:F3DFloor

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


F3DFLoor is the struct that stores information and methods for each 3D floor in the map. 3D floors are free standing room-over-room level geometry, that can (only) be created with the Sector_Set3DFloor and ExtraFloor_LightOnly line specials.

Its' internal definition can be found inside p_3dfloors.h.

Methods

  • TextureID GetTexture(Int Pos)
Returns the TextureID of the 3D floors' top or bottom flat. The pos variable specifies what plane of the 3D floor to check, 0 checks the 3D floors' top flat, and 1 checks the bottom flat.

Variables

  • ReadOnly UInt Flags
    Stores all the flags that the 3D floor has set, possible flags include:
    • FF_EXISTS - Is on if the 3D floor in question is a valid one that exists. You should check for this flag before doing any sorts of checks to a 3D floor !
    • FF_SOLID - This 3D floor is solid, and things cannot go through it normally.
    • FF_RENDERSIDES - Should this 3D floors' sides be rendered ?
    • FF_RENDERPLANES - Should the top and bottom flats of this 3D floor be rendered ?
    • FF_RENDERALL - Should the entire 3D floor be rendered ? Implied by swimmable or non-solid 3D floors.
    • FF_SWIMMABLE - This 3D floor is a swimmable water volume.
    • FF_NOSHADE - This 3D floor should not apply any light effects to the map at all, such as the 3D floors' brightness determining the brightness of the sector below it. This flag is known as "Disable light effects" in Ultimate Doom Builder.
    • FF_BOTHPLANES - Should both flat planes always be rendered ?
    • FF_TRANSLUCENT - Is this 3D floor transparent ? This flag is automatically set if the 3D floor has any alpha below 255.
    • FF_FOG - Should the fog from the 3D floors' control sector be projected to the volume the floor occupies ?
    • FF_INVERTPLANES - Should the interior of the 3D floor also be rendered, this is implied by the "Render inside" type flag in Ultimate Doom Builder.
    • FF_ALLSIDES - Should the inside and outside sides of the 3D floor be rendered ?
    • FF_INVERTSIDES - Should only the inside facing sides of the 3D floor be rendered ?
    • FF_DOUBLESHADOW - Restricts the 3D floors' lighting effects to only apply within its' boundaries. This flag is known as "Restrict light inside" in Ultimate Doom Builder.
    • FF_UPPERTEXTURE - Does the 3D floor use the upper sidedef of the line that created it, instead of the middle sidedef, to draw the 3D floors sides ? This flag is known as "Use upper texture" in Ultimate Doom Builder.
    • FF_LOWERTEXTURE - Ditto, but with the lower sidedef instead.
    • FF_THINFLOOR - This 3D floor ignores the floor of the control sector, and draws both its' top and bottom at the control sectors' ceiling. This flag is known as "Ignore bottom height" in Ultimate Doom Builder.
    • FF_SCROLLY - Does nothing.
    • FF_NODAMAGE - If on, the damage specials and properties applied to the 3D floors' control sector will not transfer over to the 3D floor itself.
    • FF_FIX - Use the floor of the control sector as the floor/top of the 3D floor, and the floor of the target sector as the ceiling. (Verification needed)
    • FF_INVERTSECTOR - The 3D floors' sector planes are inverted, meaning that the ceiling is the bottom of the 3D floor, and the floor is the top. This is used by Vavoom-style 3D floors.
    • FF_DYNAMIC - This 3D floor was been broke into chunks due to overlapping with another 3D floor.
    • FF_CLIPPED - (Need more info)
    • FF_SEETHROUGH - The actor seeing rules on this sector are inverted, allowing sight checks such as IsVisible() to see through the floor if it's solid, but not if it's non-solid. This flag is known as "Invert Visibility Rules" in Ultimate Doom Builder.
    • FF_SHOOTTHROUGH - The hitscan collision rules on this sector are inverted, meaning that hitscans will go through this 3D floor if it's solid, but will be stopped by the floor if it's non-solid. This flag is known as "Invert Shootability Rules" in Ultimate Doom Builder.
    • FF_FADEWALLS - This 3D floor has real fog applied to its' interior, instead of simply blending the players' view like FF_FOG does. This flag is known as "Fade effect (No view blend)" in Ultimate Doom Builder.
    • FF_ADDITIVETRANS - This floor is rendered with additive translucency, this also implied the FF_TRANSLUCENT flag. This flag is known as "Additive translucency" in Ultimate Doom Builder.
    • FF_FLOOD - This 3D floors' bottom extends down to the next nearest 3D floor with the same flag, the next solid 3D floor, or the bottom of the sector the 3D floor is on.
    • FF_THISINSIDE - This flag is used for a hack needed to get 3D floors with FF_BOTHPLANES to work in the software renderer.
    • FF_RESET - This flag makes the 3D floor reset the lighting effects of the ones above it. This flag is known as "Reset light effects" in Ultimate Doom Builder.
  • ReadOnly SecPlane Bottom
A reference to the 3D floors' bottom sector plane.
  • ReadOnly SecPlane Top
A reference to the 3D floors' top sector plane.
  • ReadOnly Line Master
A reference to the linedef that has the Sector_Set3DFloor special that created the 3D floor.
A reference to the control sector of the 3D floor.
  • ReadOnly Sector Target
A reference to the target of the 3D floor. That is to say, the sector that the 3D floor was specified to be created at by Sector_Set3DFloor
  • ReadOnly Int Alpha
The alpha of the 3D floor, this value can be anything between 0 and 255.

Examples

This custom pistol has an altfire which will print out several pieces of information about whatever solid 3D floor it hits.

Class F3DFloorFinder : Pistol
{
	FlineTraceData Raycaster;
	F3DFloor RORSector; //A shorthand for Raycaster.Hit3DFloor.
	States
	{
		AltFire:
			PISG A 16
			{
				A_StartSound ("Misc/Chat",CHAN_WEAPON);
				LineTrace (Angle,32768,Pitch,TRF_THRUACTORS|TRF_THRUHITSCAN|TRF_THRUBLOCK,Height/2,data:Invoker.Raycaster);
				
				Invoker.RORSector = Invoker.Raycaster.Hit3DFloor; //Store the reference to the hit 3D floor, if any, to RORSector.
				
				//Only run any of this if an actual 3D floor that exists was found.
				If (Invoker.RORSector && Invoker.RORSector.Flags & F3DFloor.FF_EXISTS)
				{
					Console.Printf ("|===========|3D FLOOR INFO|===========|");
					Console.Printf ("Control sector index: %d",Invoker.RORSector.Model.Index());
					Console.Printf ("Target sector index %d",Invoker.RORSector.Target.Index());
					Console.Printf ("Master line index %d",Invoker.RORSector.Master.Index());
					Console.Printf ("Top texture: %s",TexMan.GetName(Invoker.RORSector.GetTexture(0)));
					Console.Printf ("Bottom texture: %s",TexMan.GetName(Invoker.RORSector.GetTexture(1)));
					Console.Printf ("Alpha: %d",Invoker.RORSector.Alpha);
					If (Invoker.RORSector.Flags & F3DFloor.FF_SWIMMABLE)
						Console.Printf ("Swimmable: True");
					Else
						Console.Printf ("Swimmable: False");
					Console.Printf ("|=====================================|");
				}
				Else
					Console.Printf ("No 3D floor was found.");
			}
			Goto Ready;
	}
}

Notes:

  • All of F3Dfloors' data is read only. If you want to modify a 3D floors' properties, you can do so by modifying its' control sector.