private void InitCachedVars() { _transform = GetComponent <Transform>(); _poiTransform = string.IsNullOrEmpty(POIRootName) ? _transform.FindChild(POIRootName) : _transform; _modelTransform = string.IsNullOrEmpty(ModelRootName) ? _transform.FindChild(ModelRootName) : _transform; _rigidbody = GetComponent <Rigidbody>(); _centerOfMassTransform = POI.GetPoiByName(_poiTransform, "com"); _rigidbody.centerOfMass = _transform.TransformPoint(_centerOfMassTransform.position); _rigidbody.useGravity = false; }
private void InitHeightPID() { _heightPIDTransform = POI.GetPoiByName(_poiTransform, "height_anchor"); _pidController = new PID(Height_P, Height_I, Height_D, HeightForceLimit); }