UE1 - UT SphereBuilder

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Gizzy

The Banhammer Cometh
May 30, 2009
195
0
0
United Kingdom
In UnrealED 1 (Oh god.) There was a SphereBuilder tool (Similar to the Cube builder and such) but in UnrealED 2 it was replaced with the Tetrahedron builder. Thanks to the lack of BrushBuilder classes in any version other than 227, it's difficult for me to recreate this for 227.

I have the base of the class set up. Variables were copied from UnrealED 1. The comments are the gaps I need to fill :(

Code:
//=============================================================================
// SphereBuilder.
// A Sphere Builder from UnrealED 1
//=============================================================================
class SphereBuilder expands BrushBuilder;

Var() Float OuterRadius, InnerRadius;
Var() Int RadialSides, VerticalStripes;
Var() Name GroupName;
Var() Bool Hollow;

Function BuildSphere( /*Some stuff needs to go here*/ )
{
	// Maths junk here?
}

Function bool Build()
{
// Validity checks on the Sphere. 
	if ( OuterRadius <=0 ) 
		return BadParameters("OuterRadius must be larger than 0.");
	if ( InnerRadius <=0 )
		Return BadParameters("InnerRadius must be larger than 0.");
	if ( RadialSides < 3 )
		Return BadParameters ("Sphere must have at least 3 Radial Sides.");
	if ( VerticalStripes < 2 )
		Return BadParameters ("Sphere must have at least 2 Vertical Stripes.");
	if ( Hollow && InnerRadius >= OuterRadius )
		Return BadParameters ("The OuterRadius must be greater than InnerRadius.");

	// BeginBrush( false, GroupName );
	// BuildSphere( /*Probably need more stuff here*/ );
	// if ( Hollow )
		// Stuff to build a hollow sphere here
	// Else
		// Some more stuff.
	return EndBrush();
}

So can someone help me finish this?
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
What's wrong with the tetrahedron builder? And what's the difference, apart from being able to create hollow spheres? (Hollow objects could as well be created with two brushes.)
 

Gizzy

The Banhammer Cometh
May 30, 2009
195
0
0
United Kingdom
The way they are built is slightly different and SphereBuilder has more options like how many times to split it vertically or horizontally (Radialsides and verticalstripes)

It's a request someone made really, and I'm sure a few people would get some use out of it. (I'd like a new brushbuilder too....never had my own before :p )