easyx_framework V1.0.0
基于easyx的c++游戏框架
 
载入中...
搜索中...
未找到
F:/vc/project/esayx_framewoek/esayx_framewoek/plateform.h
浏览该文件的文档.
1#pragma once
2#include"Sprite.h"
3#include"Animator.h"
4#include"Collider.h"
5#include"RigidBody.h"
6#include"Timer.h"
7#include"Particle.h"
8
9class plateform :public Sprite
10{
12public:
14 {
17 box->SetSize({500,70});
20 box->OnComponentBeginOverlap.Push([this](Collider* overlapcomp,Collider* overlapanothercomp, Object* overlapanotherator)
21 {/*RigidBody* rigid = overlapanotherator->GetComponentByClass<RigidBody>(); if(rigid)rigid->SetMoveable(false);*/std::cout << "hallo haina"<<std::endl; }
22 );
23 box->OnComponentBeginOverlap.Push([this](Collider* overlapcomp, Collider* overlapanothercomp, Object* overlapanotherator)
24 {RigidBody* rigid = overlapanotherator->GetComponentByClass<RigidBody>(); if (rigid)rigid->SetMoveable(false); }
25 );
26 box->OnComponentHitOverlap.Push([this](Collider* overlapcomp, Collider* overlapanothercomp, Object* overlapanotherator, Vector2D impactnolunit, HitResult hitresult)
27 {RigidBody* rigid = overlapanotherator->GetComponentByClass<RigidBody>(); /*if (rigid)rigid->SetGravityEnable(false);*//*if (rigid)rigid->SetGravityEnable(false);*/
28 if(rigid)std::cout << rigid->GetVelocity()<<std::endl; }
29 );
30 /* box->OnComponentBeginOverlap.Remove([this](Collider* overlapcomp, Collider* overlapanothercomp, Object* overlapanotherator)
31 {RigidBody* rigid = overlapanotherator->GetComponentByClass<RigidBody>(); if (rigid)rigid->SetMoveable(false); }
32 );*/
33 }
34};
动画接口及动画组件
游戏场景中所有碰撞相关事件的处理
@ Collision
碰撞模式,相当于两个实体的球进行碰撞
2D粒子组件
刚体组件定义
物体派生类(精灵类)
计时器类
盒型碰撞器.
定义 Collider.h:368
void SetSize(Vector2D size)
设置大小.
定义 Collider.h:400
碰撞器基类.
定义 Collider.h:130
void SetCollisionMode(ColliderMode mode)
设置碰撞模式.
定义 Collider.h:200
void SetType(CollisionType type)
设置碰撞物体种类.
定义 Collider.h:189
CollisionHitOverlapDelegate OnComponentHitOverlap
发生实体碰撞的委托
定义 Collider.h:237
CollisionOverlapDelegate OnComponentBeginOverlap
碰撞体刚接触的委托
定义 Collider.h:235
游戏对象基类.
定义 Object.h:20
T * ConstructComponent()
创建组件,绑定到对象,并注册到对象容器.
定义 Object.h:108
T * GetComponentByClass()
访问物体对象的跟他匹配的组件.
定义 Object.h:91
SceneComponent *const root
场景根组件,赋予场景属性 刚创建物体一定同时创建了它的场景组件,不允许改变指向
定义 Object.h:28
刚体组件.
定义 RigidBody.h:16
Vector2D GetVelocity()
获取速度
定义 RigidBody.h:69
void SetMoveable(bool Moveable)
是否可移动
定义 RigidBody.h:83
void AttachTo(SceneComponent *par)
设置所属组件
定义 SceneComponent.cpp:21
物体派生类(精灵类)
定义 Sprite.h:18
定义 plateform.h:10
BoxCollider * box
定义 plateform.h:11
plateform()
定义 plateform.h:13
碰撞结果类
定义 Collider.h:42
二维向量
定义 Struct.h:18