1#include "Game/LiveActor/ShadowController.hpp"
2#include "Game/LiveActor/ShadowDrawer.hpp"
4ShadowControllerHolder::ShadowControllerHolder() :
NameObj(
"影管理"), _C(), _18(), _24(false) {
8 MR::connectToScene(
this, 0x2D, -1, -1, -1);
10 if (MR::isEqualStageName(
"AstroGalaxy") || MR::isEqualStageName(
"PeachCastleGardenGalaxy") || MR::isEqualStageName(
"PeachCastleFinalGalaxy")) {
15void ShadowControllerHolder::movement() {
19void ShadowControllerHolder::initAfterPlacement() {
20 u32 count = _C.getCount();
21 for (u32 i = 0; i < count; i++) {
23 ctrl->updateDirection();
24 ctrl->updateProjection();
28void ShadowControllerHolder::updateController() {
29 u32 count = _18.getCount();
31 for (u32 i = 0; i < count; i++) {
34 ctrl->updateFarClipping(mFarClip);
44ShadowControllerList::ShadowControllerList(
LiveActor *pActor, u32 listCount) : mShadowList(), mHost(pActor) {
45 mShadowList.init(listCount);
49 mShadowList.push_back(pController);
52u32 ShadowControllerList::getControllerCount()
const {
53 return mShadowList.mCount;
57 return mShadowList[idx];
60ShadowController* ShadowControllerList::getController(
const char *pName)
const {
61 if (mShadowList.mCount == 1) {
62 return mShadowList[0];
65 for (u32 i = 0; i < mShadowList.mCount; i++) {
66 if (MR::isEqualString(pName, mShadowList[i]->mName)) {
67 return mShadowList[i];
74void ShadowControllerList::resetCalcCount() {
75 for (u32 i = 0; i < mShadowList.getCount(); i++) {
82void ShadowControllerList::requestCalc() {
83 for (u32 i = 0; i < mShadowList.getCount(); i++) {
84 mShadowList[i]->requestCalc();
88void ShadowController::requestCalc() {
95void ShadowController::update() {
104void ShadowController::updateFarClipping(f32 clip) {
106 getDropPos(&dropPos);
107 f32 cameraDistZ = MR::calcCameraDistanceZ(dropPos);
108 _67 = cameraDistZ >= clip;
115LiveActor* ShadowController::getHost()
const {
119void ShadowController::setShadowDrawer(
ShadowDrawer *pDrawer) {
121 pDrawer->setShadowController(
this);
124void ShadowController::getDropPos(TVec3f *pOut)
const {
126 pOut->set(*mDropPos);
130 PSMTXMultVec(_1C, (
const Vec*)&_30, (Vec*)pOut);
138void ShadowController::getDropDir(TVec3f *pOut)
const {
140 pOut->set(*mDropDir);
147f32 ShadowController::getDropLength()
const {
151void ShadowController::getProjectionPos(TVec3f *pOut)
const {
153 pOut->set(*mProjPos);
160void ShadowController::getProjectionNormal(TVec3f *pOut)
const {
162 pOut->set(*mProjNorm);
169bool ShadowController::isProjected()
const {
173bool ShadowController::isDraw()
const {
186 return MR::isValidDraw(mActor);
209void ShadowController::setGroupName(
const char *pName) {
213void ShadowController::setDropPosPtr(
const TVec3f *pDropPos) {
218void ShadowController::setDropPosFix(
const TVec3f &rPos) {
224void ShadowController::setDropDirPtr(
const TVec3f *pDropDir) {
229void ShadowController::setDropDirFix(
const TVec3f &a1) {
235void ShadowController::setDropLength(f32 len) {
239void ShadowController::setDropStartOffset(f32 offs) {
243void ShadowController::setDropTypeNormal() {
247void ShadowController::setDropTypeSurface() {
251void ShadowController::setProjectionFix(
const TVec3f &a1,
const TVec3f &a2,
bool a3) {
258void ShadowController::onCalcCollision() {
262void ShadowController::offCalcCollision() {
266void ShadowController::onCalcCollisionOneTime() {
271void ShadowController::onCalcDropGravity() {
272 TVec3f vec(0.0f, 1.0f, 0.0f);
278void ShadowController::onCalcDropGravityOneTime() {
279 TVec3f vec(0.0f, 1.0f, 0.0f);
286void ShadowController::offCalcDropGravity() {
290void ShadowController::onCalcDropPrivateGravity() {
291 TVec3f vec(0.0f, 1.0f, 0.0f);
297void ShadowController::onCalcDropPrivateGravityOneTime() {
298 TVec3f vec(0.0f, 1.0f, 0.0f);
305void ShadowController::offCalcDropPrivateGravity() {
310 mCollisionPartsFilter = pBase;
313void ShadowController::onFollowHostScale() {
317void ShadowController::offFollowHostScale() {
321bool ShadowController::isFollowHostScale()
const {
325void ShadowController::onVisibleSyncHost() {
329void ShadowController::offVisibleSyncHost() {
333void ShadowController::validate() {
337void ShadowController::invalidate() {
341ShadowControllerHolder::~ShadowControllerHolder() {
The basis of a drawable actor that can contain states (see: Nerve)
The most basic form of an object.
virtual void init(const JMapInfoIter &rIter)
Intializes the NameObj and can set various settings and construct necessary classes.