Ejemplo n.º 1
0
	//初期化
	void MoveBox::Create(){
		auto PtrTransform = GetComponent<Transform>();

		PtrTransform->SetScale(m_Scale);
		PtrTransform->SetRotation(m_Rotation);
		PtrTransform->SetPosition(m_Position);

		//操舵系のコンポーネントをつける場合はRigidbodyをつける
		auto PtrRegid = AddComponent<Rigidbody>();
		auto PtrObb = AddComponent<CollisionObb>();
		PtrObb->SetFixed(true);
		PtrObb->SetDrawActive(true);


		//アクションの登録
		auto PtrAction = AddComponent<Action>();
		PtrAction->AddMoveBy(5.0f, Vector3(5.0f, 5.0f, 0));
		PtrAction->AddMoveBy(5.0f, Vector3(-5.0f, -5.0f, 0));
		//ループする
		PtrAction->SetLooped(true);
		//アクション開始
		PtrAction->Run();



		//影をつける
		auto ShadowPtr = AddComponent<Shadowmap>();
		ShadowPtr->SetMeshResource(L"DEFAULT_CUBE");

		auto PtrDraw = AddComponent<BasicPNTDraw>();
		PtrDraw->SetMeshResource(L"DEFAULT_CUBE");
		PtrDraw->SetTextureResource(L"SKY_TX");
		PtrDraw->SetOwnShadowActive(true);
	}
CVec2PropertyDescription::CVec2PropertyDescription(CSerializer* pSerializer)
    : super(NULL)
{
    SetType(eRPT_Vec2F);
    SetMaxCount(VEC_COUNT);
    SetFixed(true);
    CPropertyDescriptionBase* pFloatProperty = CComponentProxyManager::GetInstance()->CreateProperty(eRPT_Float, NULL);
    SetTemplateProperty(pFloatProperty);
    TString InitValue = _T("0,0");
    if (pSerializer != NULL)
    {
        InitValue.clear();
        for (size_t i = 0; i < VEC_COUNT; ++i)
        {
            float fValue = 0;
            (*pSerializer) >> fValue;
            InitValue.append(wxString::Format(_T("%f"),fValue));
            if (i != VEC_COUNT - 1)
            {
                InitValue.append(_T(","));
            }
            CPropertyDescriptionBase* pChild = AddChild(NULL);
            pChild->InitializeValue(fValue);
        }
        ResetChildName();
    }
Ejemplo n.º 3
0
	//初期化
	void TilingFixedBox::OnCreate() {
		auto PtrTrans = GetComponent<Transform>();
		PtrTrans->SetScale(m_Scale);
		PtrTrans->SetRotation(m_Rotation);
		PtrTrans->SetPosition(m_Position);
		auto Coll = AddComponent<CollisionObb>();
		Coll->SetFixed(true);
		vector<VertexPositionNormalTexture> vertices;
		vector<uint16_t> indices;
		MeshUtill::CreateCube(1.0f, vertices, indices);
		float UCount = m_Scale.x / m_UPic;
		float VCount = m_Scale.y / m_VPic;
		for (size_t i = 0; i < vertices.size(); i++) {
			if (vertices[i].textureCoordinate.x >= 1.0f) {
				vertices[i].textureCoordinate.x = UCount;
			}
			if (vertices[i].textureCoordinate.y >= 1.0f) {
				vertices[i].textureCoordinate.y = VCount;
			}
		}
		//描画コンポーネントの追加
		auto PtrDraw = AddComponent<BcPNTStaticDraw>();
		//描画コンポーネントに形状(メッシュ)を設定
		PtrDraw->CreateOriginalMesh(vertices, indices);
		PtrDraw->SetOriginalMeshUse(true);
		PtrDraw->SetFogEnabled(true);
		//自分に影が映りこむようにする
		PtrDraw->SetOwnShadowActive(true);
		//描画コンポーネントテクスチャの設定
		PtrDraw->SetTextureResource(L"WALL_TX");
		//タイリング設定
		PtrDraw->SetSamplerState(SamplerState::LinearWrap);

	}
Ejemplo n.º 4
0
	//初期化
	void FixedBox::OnCreate() {
		auto PtrTransform = GetComponent<Transform>();

		PtrTransform->SetScale(m_Scale);
		PtrTransform->SetRotation(m_Rotation);
		PtrTransform->SetPosition(m_Position);
		//OBB衝突j判定を付ける
		auto PtrColl = AddComponent<CollisionObb>();
		PtrColl->SetFixed(true);

		//タグをつける
		AddTag(L"FixedBox");

		//影をつける
		auto ShadowPtr = AddComponent<Shadowmap>();
		ShadowPtr->SetMeshResource(L"DEFAULT_CUBE");

		auto PtrDraw = AddComponent<BcPNTStaticDraw>();
		PtrDraw->SetFogEnabled(true);
		PtrDraw->SetMeshResource(L"DEFAULT_CUBE");
		PtrDraw->SetOwnShadowActive(true);
		PtrDraw->SetTextureResource(L"SKY_TX");


	}
Ejemplo n.º 5
0
	//初期化
	void CapsuleObject::OnCreate(){
		auto PtrTransform = AddComponent<Transform>();
		PtrTransform->SetPosition(m_StartPos);
		PtrTransform->SetScale(2.0f, 2.0f, 2.0f);
		PtrTransform->SetRotation(0.0f, 0.0f, 0.0f);
		//操舵系のコンポーネントをつける場合はRigidbodyをつける
		auto PtrRegid = AddComponent<Rigidbody>();
		//Capsuleの衝突判定をつける
		auto CollPtr = AddComponent<CollisionCapsule>();
		CollPtr->SetFixed(true);
		//コリジョンのワイアフレーム表示
		AddComponent<PNTCollisionDraw>();

		//オブジェクトのグループを得る
		auto Group = GetStage()->GetSharedObjectGroup(L"CapsuleGroup");
		//グループに自分自身を追加
		Group->IntoGroup(GetThis<CapsuleObject>());


		//影をつける
		auto ShadowPtr = AddComponent<Shadowmap>();
		ShadowPtr->SetMeshResource(L"DEFAULT_CAPSULE");

		auto PtrDraw = AddComponent<PNTStaticDraw>();
		PtrDraw->SetMeshResource(L"DEFAULT_CAPSULE");
		PtrDraw->SetTextureResource(L"SKY_TX");

	}
Ejemplo n.º 6
0
StoneHidden::StoneHidden(double X,double Y) : Stone(X,Y)
{
	visible = false;
	SetFixed(true);
	collideLeft = collideRight = collideTop = false;

}
Ejemplo n.º 7
0
Barricade::Barricade(Texture* texture_, coord_def pos_, int health_, int time_, int team_):
Unit("바리케이트",texture_, pos_.x, pos_.y, team_, health_),
time(time_)
{
	SetFixed(true);
	SetSize(8.0f);
}
Ejemplo n.º 8
0
	//初期化
	void FixedBox::Create(){
		auto PtrTransform = GetComponent<Transform>();

		PtrTransform->SetScale(m_Scale);
		PtrTransform->SetRotation(m_Rotation);
		PtrTransform->SetPosition(m_Position);

		//反発を実装する場合はRigidbodyをつける
		auto PtrRegid = AddComponent<Rigidbody>();
		//衝突判定
		auto PtrObb = AddComponent<CollisionObb>();
		PtrObb->SetFixed(true);
		PtrObb->SetDrawActive(true);

		//影をつける
		auto ShadowPtr = AddComponent<Shadowmap>();
		ShadowPtr->SetMeshResource(L"DEFAULT_CUBE");

		auto PtrDraw = AddComponent<BasicPNTDraw>();
		PtrDraw->SetMeshResource(L"DEFAULT_CUBE");
		PtrDraw->SetTextureResource(L"SKY_TX");
		PtrDraw->SetOwnShadowActive(true);
	}
Ejemplo n.º 9
0
// ========================================  SET INTERFACE VALUES  ==================================================
void TpartEditForm::SetValues()
{
	SetTag( 11801, 'spri', def.sprite_tag );

	SetTag( 11805, 'amso', def.ambient_sound_tag );
	SetTag( 11807, 'lpgr', def.splash_local_projectile_group_tag );

	SetWorldDistance( 11809, def.minimum_view_distance );
	SetWorldDistance( 11810, def.transparency_rolloff_point );
	SetWorldDistance( 11811, def.transparency_cutoff_point );
	SetInt( 11812, def.number_of_particles );
	SetShortFixed( 11813, def.scale );
	SetShortWorldDistance( 11901, def.box_bottom_height );
	SetShortWorldDistance( 11902, def.box_top_height );

	if(def.flags&_particle_system_states_last_indefinitely_flag ) {
		SetFlag( 11814, TRUE );
	} else {
		SetFlag( 11814, FALSE );
	}
	if(def.flags&_particle_system_does_not_affect_projectiles_flag ) {
		SetFlag( 11815, TRUE );
	} else {
		SetFlag( 11815, FALSE );
	}
	if(def.flags&_particle_system_transparency_varies_with_distance_flag ) {
		SetFlag( 11816, TRUE );
	} else {
		SetFlag( 11816, FALSE );
	}
	if(def.flags&_particle_system_aligns_to_direction_flag ) {
		SetFlag( 11900, TRUE );
	} else {
		SetFlag( 11900, FALSE );
	}

	SetShortFixed (11817, def.y1_particle_number);
	SetShortFixed (11818, def.x1_particle_number);
	SetShortFixed (11819, def.x0_particle_number);
	SetShortFixed (11820, def.y0_particle_number);
	
	SetFixed( 11821, def.velocity_lower_bound.i );
	SetFixed( 11822, def.velocity_lower_bound.i + def.velocity_delta.i );
	SetFixed( 11823, def.velocity_lower_bound.j );
	SetFixed( 11824, def.velocity_lower_bound.j + def.velocity_delta.j );
	SetFixed( 11825, def.velocity_lower_bound.k );
	SetFixed( 11826, def.velocity_lower_bound.k + def.velocity_delta.k );
	
	SetInt( 11827, def.state[_not_snowing].duration_lower_bound / TICKS_PER_SECOND);
	SetInt( 11828, (def.state[_not_snowing].duration_lower_bound + def.state[_not_snowing].duration_delta) / TICKS_PER_SECOND );
	SetPercentage( 11829, def.state[_not_snowing].value_lower_bound );
	SetPercentage( 11830, def.state[_not_snowing].value_lower_bound + def.state[_not_snowing].value_delta );
	SetInt( 11831, def.state[_not_snowing].transition_lower_bound / TICKS_PER_SECOND );
	SetInt( 11832, (def.state[_not_snowing].transition_lower_bound + def.state[_not_snowing].transition_delta) / TICKS_PER_SECOND );

	SetInt( 11833, def.state[_snowing].duration_lower_bound / TICKS_PER_SECOND );
	SetInt( 11834, (def.state[_snowing].duration_lower_bound + def.state[_snowing].duration_delta) / TICKS_PER_SECOND );
	SetPercentage( 11835, def.state[_snowing].value_lower_bound );
	SetPercentage( 11836, def.state[_snowing].value_lower_bound + def.state[_snowing].value_delta );
	SetInt( 11837, def.state[_snowing].transition_lower_bound / TICKS_PER_SECOND );
	SetInt( 11838, (def.state[_snowing].transition_lower_bound + def.state[_snowing].transition_delta) / TICKS_PER_SECOND );

}
Ejemplo n.º 10
0
void CBaseAlien::Read(CLevelParserLine* line)
{
    COldObject::Read(line);

    SetFixed(line->GetParam("fixed")->AsBool(false));
}
Ejemplo n.º 11
0
StabL::StabL(double X,double Y) : JvSprite(X,Y)
{
	SetFixed(true);
	loadGraphic("stab_tile_l.png");
}