//-----------------------------------------------------------------------
void OnTimeObserverPropertyWindow::copyAttributesFromObserver(ParticleUniverse::ParticleObserver* observer)
{
	ObserverPropertyWindow::copyAttributesFromObserver(observer);

	// Copy properties from observer to property window
	ParticleUniverse::OnTimeObserver* onTimeObserver = static_cast<ParticleUniverse::OnTimeObserver*>(observer);

	// Time Threshold - Compare: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_ON_TIME_COMPARE);
	ParticleUniverse::ComparisionOperator compare = onTimeObserver->getCompare();
	wxString compareString = PRNL_COMPARE_LESS_THAN;
	if (compare == ParticleUniverse::CO_GREATER_THAN)
	{
		compareString = PRNL_COMPARE_GREATER_THAN;
	}
	else if (compare == ParticleUniverse::CO_EQUALS)
	{
		compareString = PRNL_COMPARE_EQUALS;
	}
	propTo->SetValueFromString(compareString);

	// Time Threshold - Value: ParticleUniverse::Real
	doSetDouble(PRNL_ON_TIME_THRESHOLD, onTimeObserver->getThreshold());

	// Since Start System: bool
	doSetBool(PRNL_SINCE_START_SYSTEM, onTimeObserver->isSinceStartSystem());
}
//-----------------------------------------------------------------------
void TextureAnimatorPropertyWindow::copyAttributesFromAffector(ParticleUniverse::ParticleAffector* affector)
{
	AffectorPropertyWindow::copyAttributesFromAffector(affector);

	// Copy properties from affector to property window
	ParticleUniverse::TextureAnimator* textureAnimator = static_cast<ParticleUniverse::TextureAnimator*>(affector);

	// Time Step Animation: ParticleUniverse::Real
	doSetDouble(PRNL_TIME_STEP, textureAnimator->getAnimationTimeStep());

	// Animation Type: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_ANIMATION_TYPE);
	ParticleUniverse::TextureAnimator::TextureAnimationType animationType = textureAnimator->getTextureAnimationType();
	wxString animationTypeString = TAT_LOOP;
	if (animationType == ParticleUniverse::TextureAnimator::TAT_UP_DOWN)
	{
		animationTypeString = TAT_UP_DOWN;
	}
	else if (animationType == ParticleUniverse::TextureAnimator::TAT_RANDOM)
	{
		animationTypeString = TAT_RANDOM;
	}
	propTo->SetValueFromString(animationTypeString);

	// Start Texture Coordinates: ParticleUniverse::uint16
	doSetUint16(PRNL_TEXCOORDS_START, textureAnimator->getTextureCoordsStart());

	// End Texture Coordinates: ParticleUniverse::uint16
	doSetUint16(PRNL_TEXCOORDS_END, textureAnimator->getTextureCoordsEnd());

	// Random Start: bool
	doSetBool(PRNL_START_RANDOM, textureAnimator->isStartRandom());
}
Esempio n. 3
0
void TechniquePropertyGridPage::lodIndexChanged(EventArgs& args)
{
	TechniqueEventArgs tea = dynamic_cast<TechniqueEventArgs&>(args);
	TechniqueController* tc = tea.getTechniqueController();

	wxPGProperty* prop = GetPropertyPtr(mLodIndexId);
	if(prop == NULL) return;
	prop->SetValueFromInt(tc->getTechnique()->getLodIndex());
}
Esempio n. 4
0
void TechniquePropertyGridPage::schemeNameChanged(EventArgs& args)
{
	TechniqueEventArgs tea = dynamic_cast<TechniqueEventArgs&>(args);
	TechniqueController* tc = tea.getTechniqueController();

	wxPGProperty* prop = GetPropertyPtr(mSchemeNameId);
	if(prop == NULL) return;
	prop->SetValueFromString(tc->getTechnique()->getSchemeName().c_str());
}
//-----------------------------------------------------------------------
void PlaneColliderPropertyWindow::copyAttributesFromAffector(ParticleUniverse::ParticleAffector* affector)
{
	AffectorPropertyWindow::copyAttributesFromAffector(affector);

	// Copy properties from affector to property window
	ParticleUniverse::PlaneCollider* planeCollider = static_cast<ParticleUniverse::PlaneCollider*>(affector);

	// Normal: Ogre::Vector3
	doSetVector3(PRNL_PLANE_COLLIDER_NORMAL, planeCollider->getNormal());

	// Friction: ParticleUniverse::Real
	doSetDouble(PRNL_COLLIDER_FRICTION, planeCollider->getFriction());

	// Bouncyness: ParticleUniverse::Real
	doSetDouble(PRNL_COLLIDER_BOUNCYNESS, planeCollider->getBouncyness());

	// Intersection type: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_INTERSECTION_TYPE);
	ParticleUniverse::BaseCollider::IntersectionType intersectionType = planeCollider->getIntersectionType();
	wxString intersectionTypeString = IST_POINT;
	if (intersectionType == ParticleUniverse::BaseCollider::IT_BOX)
	{
		intersectionTypeString = IST_BOX;
	}
	propTo->SetValueFromString(intersectionTypeString);

	// Collision type: List
	propTo = GetPropertyPtr(PRNL_COLLISION_TYPE);
	ParticleUniverse::BaseCollider::CollisionType collisionType = planeCollider->getCollisionType();
	wxString collisionTypeString = COLLT_NONE;
	if (collisionType == ParticleUniverse::BaseCollider::CT_BOUNCE)
	{
		collisionTypeString = COLLT_BOUNCE;
	}
	else if (collisionType == ParticleUniverse::BaseCollider::CT_FLOW)
	{
		collisionTypeString = COLLT_FLOW;
	}
	propTo->SetValueFromString(collisionTypeString);
}
//-----------------------------------------------------------------------
void DoScaleEventHandlerPropertyWindow::copyAttributesFromEventHandler(ParticleUniverse::ParticleEventHandler* eventHandler)
{
	EventHandlerPropertyWindow::copyAttributesFromEventHandler(eventHandler);

	// Copy properties from eventHandler to property window
	ParticleUniverse::DoScaleEventHandler* doScaleEventHandler = static_cast<ParticleUniverse::DoScaleEventHandler*>(eventHandler);

	// Scale Fraction: Ogre:: Real
	doSetDouble(PRNL_SCALE_FRACTION, doScaleEventHandler->getScaleFraction());

	// Scale Type: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_SCALE_TYPE);
	ParticleUniverse::DoScaleEventHandler::ScaleType scaleType = doScaleEventHandler->getScaleType();
	wxString scaleTypeString = SC_TIME_TO_LIVE;
	if (scaleType == ParticleUniverse::DoScaleEventHandler::ST_VELOCITY)
	{
		scaleTypeString = SC_VELOCITY;
	}
	propTo->SetValueFromString(scaleTypeString);
}
//-----------------------------------------------------------------------
void OnVelocityObserverPropertyWindow::copyAttributesFromObserver(ParticleUniverse::ParticleObserver* observer)
{
	ObserverPropertyWindow::copyAttributesFromObserver(observer);

	// Copy properties from observer to property window
	ParticleUniverse::OnVelocityObserver* onVelocityObserver = static_cast<ParticleUniverse::OnVelocityObserver*>(observer);

	// Velocity threshold - compare: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_ON_VELOCITY_COMPARE);
	ParticleUniverse::ComparisionOperator compare = onVelocityObserver->getCompare();
	wxString compareString = PRNL_COMPARE_LESS_THAN;
	if (compare == ParticleUniverse::CO_GREATER_THAN)
	{
		compareString = PRNL_COMPARE_GREATER_THAN;
	}
	else if (compare == ParticleUniverse::CO_EQUALS)
	{
		compareString = PRNL_COMPARE_EQUALS;
	}
	propTo->SetValueFromString(compareString);

	// Velocity threshold - value: ParticleUniverse::Real
	doSetDouble(PRNL_ON_VELOCITY_THRESHOLD, onVelocityObserver->getThreshold());
}
//-----------------------------------------------------------------------
void BillboardRendererPropertyWindow::copyAttributesFromRenderer(ParticleUniverse::ParticleRenderer* renderer)
{
	RendererPropertyWindow::copyAttributesFromRenderer(renderer);

	// Copy properties from renderer to property window
	ParticleUniverse::BillboardRenderer* billboardRenderer = static_cast<ParticleUniverse::BillboardRenderer*>(renderer);

	// Billboard Type: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_BILLBOARD_TYPE);
	ParticleUniverse::BillboardRenderer::BillboardType billboardType = billboardRenderer->getBillboardType();
	wxString billboardTypeString = BBT_POINT;
	if (billboardType == ParticleUniverse::BillboardRenderer::BBT_ORIENTED_COMMON)
	{
		billboardTypeString = BBT_ORIENTED_COMMON;
	}
	else if (billboardType == ParticleUniverse::BillboardRenderer::BBT_ORIENTED_SELF)
	{
		billboardTypeString = BBT_ORIENTED_SELF;
	}
	else if (billboardType == ParticleUniverse::BillboardRenderer::BBT_PERPENDICULAR_COMMON)
	{
		billboardTypeString = BBT_PERPENDICULAR_COMMON;
	}
	else if (billboardType == ParticleUniverse::BillboardRenderer::BBT_PERPENDICULAR_SELF)
	{
		billboardTypeString = BBT_PERPENDICULAR_SELF;
	}
	else if (billboardType == ParticleUniverse::BillboardRenderer::BBT_ORIENTED_SHAPE)
	{
		billboardTypeString = BBT_ORIENTED_SHAPE;
	}
	propTo->SetValueFromString(billboardTypeString);

	// Origin: List
	propTo = GetPropertyPtr(PRNL_ORIGIN);
	Ogre::BillboardOrigin origin = billboardRenderer->getBillboardOrigin();
	wxString originString = ORG_CENTER;
	if (origin == Ogre::BBO_BOTTOM_CENTER)
	{
		originString = ORG_BOTTOM_CENTER;
	}
	else if (origin == Ogre::BBO_BOTTOM_LEFT)
	{
		originString = ORG_BOTTOM_LEFT;
	}
	else if (origin == Ogre::BBO_BOTTOM_RIGHT)
	{
		originString = ORG_BOTTOM_RIGHT;
	}
	else if (origin == Ogre::BBO_CENTER_LEFT)
	{
		originString = ORG_CENTER_LEFT;
	}
	else if (origin == Ogre::BBO_CENTER_RIGHT)
	{
		originString = ORG_CENTER_RIGHT;
	}
	else if (origin == Ogre::BBO_TOP_CENTER)
	{
		originString = ORG_TOP_CENTER;
	}
	else if (origin == Ogre::BBO_TOP_LEFT)
	{
		originString = ORG_TOP_LEFT;
	}
	else if (origin == Ogre::BBO_TOP_RIGHT)
	{
		originString = ORG_TOP_RIGHT;
	}
	propTo->SetValueFromString(originString);

	// Rotation Type: List
	propTo = GetPropertyPtr(PRNL_ROTATION_TYPE);
	Ogre::BillboardRotationType rotationType = billboardRenderer->getBillboardRotationType();
	wxString rotationTypeString = RT_VERTEX;
	if (rotationType == Ogre::BBR_TEXCOORD)
	{
		rotationTypeString = RT_TEXTURE_COORDINATES;
	}
	propTo->SetValueFromString(rotationTypeString);

	// Common Direction: Ogre::Vector3
	doSetVector3(PRNL_COMMON_DIRECTION, billboardRenderer->getCommonDirection());

	// Common Up Vector: Ogre::Vector3
	doSetVector3(PRNL_UP_VECTOR, billboardRenderer->getCommonUpVector());

	// Point Rendering: bool
	doSetBool(PRNL_POINT_RENDERING, billboardRenderer->isPointRenderingEnabled());

	// Accurate Facing: List
	propTo = GetPropertyPtr(PRNL_ACCURATE_FACING);
	wxString accurateFacingString = ACF_OFF;
	if (billboardRenderer->isUseAccurateFacing())
	{
		accurateFacingString = ACF_ON;
	}
	propTo->SetValueFromString(accurateFacingString);

	// Use soft particles: Bool
	doSetBool(PRNL_RENDERER_USE_SOFT_PARTICLES, renderer->getUseSoftParticles());

	// Soft particles contrast power: ParticleUniverse::Real
	doSetDouble(PRNL_RENDERER_SOFT_PARTICLES_CONTRAST_POWER, renderer->getSoftParticlesContrastPower());

	// Soft particles scale: ParticleUniverse::Real
	doSetDouble(PRNL_RENDERER_SOFT_PARTICLES_SCALE, renderer->getSoftParticlesScale());

	// Soft particles delta: ParticleUniverse::Real
	doSetDouble(PRNL_RENDERER_SOFT_PARTICLES_DELTA, renderer->getSoftParticlesDelta());
}
//-----------------------------------------------------------------------
void PhysXFluidExternPropertyWindow::copyAttributesFromExtern(ParticleUniverse::Extern* externObject)
{
	ExternPropertyWindow::copyAttributesFromExtern(externObject);

	// Copy properties from Extern to property window
	ParticleUniverse::PhysXFluidExtern* physXFluidExtern = static_cast<ParticleUniverse::PhysXFluidExtern*>(externObject);

	// Rest particle per meter: NxReal
	doSetDouble(PRNL_PHYSX_REST_PARTICLE_PER_METER, physXFluidExtern->mFluidDesc.restParticlesPerMeter);

	// Rest density: NxReal
	doSetDouble(PRNL_PHYSX_REST_DENSITY, physXFluidExtern->mFluidDesc.restDensity);

	// Kernel radius multiplier: NxReal
	doSetDouble(PRNL_PHYSX_KERNEL_RADIUS_MULTIPLIER, physXFluidExtern->mFluidDesc.kernelRadiusMultiplier);

	// Motion limit multiplier: NxReal
	doSetDouble(PRNL_PHYSX_MOTION_LIMIT_MULTIPLIER, physXFluidExtern->mFluidDesc.motionLimitMultiplier);

	// Collision distance multiplier: NxReal
	doSetDouble(PRNL_PHYSX_COLLISION_DISTANCE_MULTIPLIER, physXFluidExtern->mFluidDesc.collisionDistanceMultiplier);

	// Packet size multiplier: NxU32
	doSetLong(PRNL_PHYSX_PACKET_SIZE_MULTIPLIER, physXFluidExtern->mFluidDesc.packetSizeMultiplier);

	// Stiffness: NxReal
	doSetDouble(PRNL_PHYSX_STIFFNESS, physXFluidExtern->mFluidDesc.stiffness);

	// Viscosity: NxReal
	doSetDouble(PRNL_PHYSX_VISCOSITY, physXFluidExtern->mFluidDesc.viscosity);

	// Surface tension: NxReal
	doSetDouble(PRNL_PHYSX_SURFACE_TENSION, physXFluidExtern->mFluidDesc.surfaceTension);

	// Damping: NxReal
	doSetDouble(PRNL_PHYSX_DAMPING, physXFluidExtern->mFluidDesc.damping);
	
	// External acceleration: NxVec3
	doSetVector3(PRNL_PHYSX_EXTERNAL_ACCELERATION, ParticleUniverse::PhysXMath::convert(physXFluidExtern->mFluidDesc.externalAcceleration));

	// Restitution for static shapes: NxReal
	doSetDouble(PRNL_PHYSX_RESTITUTION_FOR_STATIC_SHAPES, physXFluidExtern->mFluidDesc.restitutionForStaticShapes);

	// Dynamic friction for static shapes: NxReal
	doSetDouble(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_STATIC_SHAPES, physXFluidExtern->mFluidDesc.dynamicFrictionForStaticShapes);

	// Static friction for static shapes: NxReal
	doSetDouble(PRNL_PHYSX_STATIC_FRICTION_FOR_STATIC_SHAPES, physXFluidExtern->mFluidDesc.staticFrictionForStaticShapes);

	// Attraction for static shapes: NxReal
	doSetDouble(PRNL_PHYSX_ATTRACTION_FOR_STATIC_SHAPES, physXFluidExtern->mFluidDesc.attractionForStaticShapes);

	// Restitution for dynamic shapes: NxReal
	doSetDouble(PRNL_PHYSX_RESTITUTION_FOR_DYNAMIC_SHAPES, physXFluidExtern->mFluidDesc.restitutionForDynamicShapes);

	// Dynamic friction for dynamic shapes: NxReal
	doSetDouble(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_DYNAMIC_SHAPES, physXFluidExtern->mFluidDesc.dynamicFrictionForDynamicShapes);

	// Static friction for dynamic shapes: NxReal
	doSetDouble(PRNL_PHYSX_STATIC_FRICTION_FOR_DYNAMIC_SHAPES, physXFluidExtern->mFluidDesc.staticFrictionForDynamicShapes);

	// Attraction for dynamic shapes: NxReal
	doSetDouble(PRNL_PHYSX_ATTRACTION_FOR_DYNAMIC_SHAPES, physXFluidExtern->mFluidDesc.attractionForDynamicShapes);

	// Collision response coefficient: NxReal
	doSetDouble(PRNL_PHYSX_COLLISION_RESPONSE_COEFFICIENT, physXFluidExtern->mFluidDesc.collisionResponseCoefficient);

	// Collision group: NxCollisionGroup
	doSetLong(PRNL_PHYSX_COLLISION_GROUP, physXFluidExtern->mFluidDesc.collisionGroup);

	// Simulation method: List
	wxPGProperty* propTo = GetPropertyPtr(PRNL_PHYSX_SIMULATION_METHOD);
	NxU32 simulationMethod = physXFluidExtern->mFluidDesc.simulationMethod;
	wxString simulationMethodString = PHYSX_INTERCOLLISION;
	if (simulationMethod == NX_F_NO_PARTICLE_INTERACTION)
	{
		simulationMethodString = PHYSX_NOINTERCOLLISION;
	}
	else if (simulationMethod == NX_F_NO_PARTICLE_INTERACTION)
	{
		simulationMethodString = PHYSX_MIX_INTERCOLLISION;
	}
	propTo->SetValueFromString(simulationMethodString);

	// Collision method: List
	propTo = GetPropertyPtr(PRNL_PHYSX_COLLISION_METHOD);
	NxU32 collisionMethod = physXFluidExtern->mFluidDesc.collisionMethod;
	wxString collisionMethodString = PHYSX_STATIC;
	if (collisionMethod == NX_F_DYNAMIC)
	{
		collisionMethodString = PHYSX_DYNAMIC;
	}
	propTo->SetValueFromString(simulationMethodString);

	// Visualisation: bool
	doSetBool(PRNL_PHYSX_FLAG_VISUALIZATION, (physXFluidExtern->mFluidDesc.flags & NX_FF_VISUALIZATION));

	// Disable gravity: bool
	doSetBool(PRNL_PHYSX_FLAG_DISABLE_GRAVITY, (physXFluidExtern->mFluidDesc.flags & NX_FF_DISABLE_GRAVITY));

	// Collision twoway: bool
	doSetBool(PRNL_PHYSX_FLAG_COLLISION_TWOWAY, (physXFluidExtern->mFluidDesc.flags & NX_FF_COLLISION_TWOWAY));

	// Fluid enabled: bool
	doSetBool(PRNL_PHYSX_FLAG_FLUID_ENABLED, (physXFluidExtern->mFluidDesc.flags & NX_FF_ENABLED));

	// Hardware: bool
	doSetBool(PRNL_PHYSX_FLAG_HARDWARE, (physXFluidExtern->mFluidDesc.flags & NX_FF_HARDWARE));

	// Priority mode: bool
	doSetBool(PRNL_PHYSX_FLAG_PRIORITY_MODE, (physXFluidExtern->mFluidDesc.flags & NX_FF_PRIORITY_MODE));

	// Project to plane: bool
	doSetBool(PRNL_PHYSX_FLAG_PROJECT_TO_PLANE, (physXFluidExtern->mFluidDesc.flags & NX_FF_PROJECT_TO_PLANE));

	// Strict cooking format: bool
	doSetBool(PRNL_PHYSX_FLAG_STRICT_COOKING_FORMAT, (physXFluidExtern->mFluidDesc.flags & NX_FF_FORCE_STRICT_COOKING_FORMAT));
}